@tinycloud/sdk-core 3.8.0-beta.1 → 3.8.0-beta.14
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 +65 -6
- package/dist/delegations/index.cjs.map +1 -1
- package/dist/delegations/index.d.cts +4 -2
- package/dist/delegations/index.d.ts +4 -2
- package/dist/delegations/index.js +66 -7
- package/dist/delegations/index.js.map +1 -1
- package/dist/delegations/issued.cjs +697 -0
- package/dist/delegations/issued.cjs.map +1 -0
- package/dist/delegations/issued.d.cts +54 -0
- package/dist/delegations/issued.d.ts +54 -0
- package/dist/delegations/issued.js +674 -0
- package/dist/delegations/issued.js.map +1 -0
- package/dist/index.cjs +118 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +124 -12
- package/dist/index.js.map +1 -1
- package/dist/{recipient-types.schema-BApcOn1t.d.cts → recipient-types.schema-BIJcihno.d.cts} +42 -1741
- package/dist/{recipient-types.schema-BApcOn1t.d.ts → recipient-types.schema-Ebi5aliq.d.ts} +42 -1741
- package/dist/types.schema-BmN-OnCA.d.cts +1763 -0
- package/dist/types.schema-BmN-OnCA.d.ts +1763 -0
- package/package.json +9 -4
package/dist/index.d.cts
CHANGED
|
@@ -3,10 +3,12 @@ import { br as CredentialHolderBinding, bs as CredentialFlowDescriptor, bt as Cr
|
|
|
3
3
|
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, d as AttestedEnforcerBindingV2, B as BuildPolicyCredentialPresentationV3Input, e as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, bz as CREDENTIAL_ACQUISITION_PROTOCOL, bA as CREDENTIAL_CONTRACT_VERSION, bB as CREDENTIAL_FORMAT, bz as CREDENTIAL_PROTOCOL, bC as CREDENTIAL_STEP_REGISTRY_VERSION, f as CompactPolicyDescendantInput, h as CompactUcanAuthorizationV1, bD as CredentialClaimDescriptor, bE as CredentialEndpointId, bF as CredentialInputDescriptor, bG as CredentialProgressEvent, bH as CredentialStepDescriptor, bI as CredentialStepType, bJ as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, i as EIP191_JCS_SIGNATURE_SUITE, bK as HOLDER_BINDING_DOMAIN, bL as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, j as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, k as POLICY_CAPABILITY_V1_DOMAIN, l as POLICY_CAPABILITY_V1_SCHEMA, m as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, n as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, o as POLICY_ENGINE_RECORD_SCHEMA, p as POLICY_PRESENTATION_V3_DOMAIN, q as POLICY_PRESENTATION_V3_SCHEMA, r as POLICY_PRESENTATION_V4_DOMAIN, s as POLICY_PRESENTATION_V4_SCHEMA, t as POLICY_SCHEMA, u as POLICY_SESSION_UCAN_V1_PROFILE, v as POLICY_STATUS_SCHEMA, w as POLICY_V1_DOMAIN, x as POLICY_V1_SCHEMA, y as POLICY_V2_DOMAIN, z as POLICY_V2_SCHEMA, a as Policy, F as PolicyCredentialAdmissionV3, G as PolicyCredentialAdmissionV4, H as PolicyCredentialPresentationV3, I as PolicyCredentialPresentationV4, K as PolicyCredentialRequirementV1, P as PolicyEngineRecord, O as PolicyRootStatusV3, Q as PolicyRootV3, R as PolicySessionUcanFactV1, T as PolicySessionUcanV1, V as PolicyStatus, W as ROOT_REVOCATION_V1_DOMAIN, X as ROOT_REVOCATION_V1_SCHEMA, Y as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, Z as ROOT_STATUS_RENEWAL_V1_DOMAIN, _ as ROOT_STATUS_V1_DOMAIN, $ as RegisterPolicyV3Input, a0 as RegisterPolicyV3Receipt, a1 as SignCompactUcanAuthorizationInput, a2 as SignCompactUcanRootAuthorizationInput, a3 as SignatureMaterialError, a4 as SignatureSuite, a5 as SignatureVerificationError, a6 as SignedObjectCanonicalizationError, a7 as SignedObjectDigestError, a8 as SignedObjectErrorCode, a9 as SignedObjectIdError, aa as SignedObjectKind, ab as SignedObjectMaterial, ac as SignedObjectProfileError, ad as SignedObjectSchemaError, ae as SignedObjectSignature, S as SignedObjectSigner, af as SignedObjectVerificationResult, ag as SignedPolicyObject, ah as SigningKeyBindingError, ai as UnifiedContentSource, aj as UnifiedEncryptionCapability, ak as UnifiedKvCapability, al as UnifiedNativeCapability, am as UnifiedPolicyCapability, an as UnifiedPolicyV1, ao as UnifiedPolicyV2, ap as UnifiedResourceSelector, aq as UnsignedPolicy, ar as UnsignedPolicyCredentialPresentationV4, U as UnsignedPolicyEngineRecord, as as UnsignedPolicyObject, at as UnsignedPolicyStatus, au as UnsignedUnifiedPolicyV2, av as UnsupportedSignatureSuiteError, aw as admitPolicyCredentialV3, ax as admitPolicyCredentialV4, ay as buildPolicyCredentialPresentationV3, az as buildPolicyCredentialPresentationV4, aA as canonicalizeSignedObjectUnsigned, aB as canonicalizeUnifiedPolicyCapability, aC as compactAttenuationContains, aD as contentSourceDigestHex, aE as createAndSignPolicy, aF as createAndSignPolicyEngineRecord, aG as createAndSignPolicyStatus, aH as createAndSignSignedObject, aK as deriveSignedObjectMaterial, aL as getPolicyRootStatusV3, aM as issuedCredentialEnvelopeFromVerified, aO as normalizeUnifiedPolicyCapability, aP as parseCompactUcanAuthorization, aQ as parsePolicySessionUcan, aR as parseSignedCompactUcanAttenuation, aS as policyCidFromCanonicalBytes, aT as policyDigestHex, aU as policyIdForDigestHex, aV as policyV2DigestHex, aW as projectUnifiedPolicyCapabilities, aX as projectUnifiedPolicyCapability, aY as registerPolicyV3, aZ as renewPolicyRootStatusV3, a$ as revokePolicyRootV3, b0 as signCompactPolicyDescendant, b1 as signCompactUcanAuthorization, b2 as signCompactUcanRootAuthorization, b3 as signPolicyCredentialPresentationV4, b4 as signedObjectIdFor, b5 as toSignedObjectError, b6 as unifiedNativeProjectionHashHex, b7 as unifiedPolicyCapabilityContains, b8 as unifiedPolicyCapabilityDigestHex, b9 as unifiedPolicyCapabilityFromNative, ba as validatePolicyCredentialRequirementV1, bb as validatePolicyEngineRecordSigned, bc as validatePolicyEngineRecordSignedShape, bd as validatePolicyEngineRecordUnsigned, be as validatePolicySigned, bf as validatePolicySignedShape, bg as validatePolicyStatusSigned, bh as validatePolicyStatusSignedShape, bi as validatePolicyStatusUnsigned, bj as validatePolicyUnsigned, bk as validateUnifiedPolicyV2, bl as verifyPolicy, bm as verifyPolicyEngineRecord, bn as verifyPolicyRootRevocationV3, bo as verifyPolicyRootStatusCheckpointV3, bp as verifyPolicyStatus, bq as verifySignedObject } from './credential-admission-Cg1M9uyV.cjs';
|
|
4
4
|
export { canonicalEmailDomain, canonicalMailbox, isCanonicalEmailDomain, mailboxBelongsToDomain } from '@tinycloud/share-envelope';
|
|
5
5
|
import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, ServiceSession, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
|
|
6
|
-
export { AuthorityRefusal, AuthorizationVerdict, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, IStorageService, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVBatchReadResponse, KVChange, KVChangesAuthority, KVChangesOptions, KVChangesResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListPage, KVListResponse, KVPutOptions, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PinnedKey, PrefixedKVService, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedReplicationOptions, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_NEARLY_FULL_RATIO, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageFullHandler, StorageFullMonitor, StorageRejectionDetails, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, appSecretScope, authorizationVerdictOf, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, isStorageFullError, networkDiscoveryKey, ok, openWrappedKey, parseCapabilityResource, parseNetworkId, parseSecretCatalogKey, parseStorageRejection, parseStorageStatus, resolveSecretListPrefix, resolveSecretPath, serviceError, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validatedCapabilityOf, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
6
|
+
export { AuthorityRefusal, AuthorizationVerdict, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, IStorageService, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVBatchReadResponse, KVChange, KVChangesAuthority, KVChangesOptions, KVChangesResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListPage, KVListResponse, KVPutOptions, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PinnedKey, PrefixedKVService, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaLocalEraseOutcome, ReplicaPurgeError, ReplicaPurgeFailedEvent, ReplicaPurgeLocalCopyResult, ReplicaPurgeTrigger, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedReplicationOptions, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_NEARLY_FULL_RATIO, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageFullHandler, StorageFullMonitor, StorageRejectionDetails, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, appSecretScope, authorizationVerdictOf, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, isStorageFullError, networkDiscoveryKey, ok, openWrappedKey, parseCapabilityResource, parseNetworkId, parseSecretCatalogKey, parseStorageRejection, parseStorageStatus, resolveSecretListPrefix, resolveSecretPath, serviceError, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validatedCapabilityOf, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
7
7
|
export { HOLDER_KEY_BINDING_PRESENTATION_SCHEMA, HolderKeyBindingPresentation, LISTEN_SQL_STATEMENT_CATALOG, ListenSqlStatementName, POLICY_ENGINE_CHALLENGE_REQUEST_SCHEMA, POLICY_ENGINE_CHALLENGE_RESPONSE_SCHEMA, POLICY_ENGINE_DENIAL_SCHEMA, POLICY_ENGINE_GRANT_PRESENTATION_DENIAL_CODES, POLICY_ENGINE_RESOLVE_REQUEST_SCHEMA, PORTABLE_DELEGATION_SCHEMA, PolicyEngineGrantPresentationDenialCode, PortableDelegation, REQUESTER_ENGINE_RETRY_ATTEMPTS, REQUESTER_ENGINE_RETRY_MAX_DELAY_MS, REQUESTER_NEAR_EXPIRY_SECONDS, RequesterEndpointResolution, RequesterHttpRequest, RequesterHttpResponse, RequesterInvocationCapability, RequesterSigningCapability, RequesterTransport, TranscriptRequester, TranscriptRequesterError, TranscriptRequesterErrorCode, TranscriptRequesterErrorState, TranscriptRequesterOptions, TranscriptRequesterReadKvResult, TranscriptRequesterReadSqlResult, createTranscriptRequester, deriveDelegationCid, parseNodeNativePortableDelegation } from './requester/index.cjs';
|
|
8
|
-
import {
|
|
9
|
-
export { b as AccountDelegationRecord, c as AccountDelegationResource, C as
|
|
8
|
+
import { h as Delegation, d as CreateDelegationParams, G as GenerateShareParams, v as ShareLink, y as SpaceInfo, a as AccountDelegationQueryOptions, A as AccountDelegationPage, r as DelegationRevocationReceipt } from './types.schema-BmN-OnCA.cjs';
|
|
9
|
+
export { b as AccountDelegationRecord, c as AccountDelegationResource, C as CapabilityEntry, e as CreateDelegationWasmParams, f as CreateDelegationWasmResult, g as DelegatedResource, i as DelegationApiResponse, j as DelegationChain, k as DelegationChainV2, l as DelegationDirection, D as DelegationError, m as DelegationErrorCode, n as DelegationErrorCodes, o as DelegationFilters, p as DelegationManagerConfig, q as DelegationRecord, R as DelegationResult, s as DelegationStatus, I as IngestOptions, J as JWK, K as KeyInfo, t as KeyProvider, u as KeyType, S as SessionInvocationSigner, w as ShareLinkData, x as ShareSchema, z as SpaceOwnership } from './types.schema-BmN-OnCA.cjs';
|
|
10
|
+
import { I as ICapabilityKeyRegistry, h as ISharingService, f as DelegationManager } from './recipient-types.schema-BIJcihno.cjs';
|
|
11
|
+
export { C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, bl as CapabilityKeyRegistry, bm as CapabilityKeyRegistryErrorCode, bn as CapabilityKeyRegistryErrorCodes, a as CreateOwnerDelegationParams, b as CredentialInvitationRequest, D as DELIVERY_ADMISSION_DOMAIN, c as DelegateReceivedShareParams, d as DelegatedShareAccess, e as DelegatedShareKey, g as DeliveryAdmission, E as EncodedShareData, M as MAX_CONTENT_BYTES, i as MAX_SEALED_SHARE_CONTENT_BYTES, j as MAX_SHARE_ARTIFACT_BYTES, k as MAX_SHARE_CONTENT_BYTES, l as MemorySenderShareKeyStorage, m as MemorySenderShareRecordStorage, n as MemoryShareCache, O as OwnerDelegationPermission, o as OwnerDelegationReceipt, p as OwnerShareAction, q as OwnerShareDecryption, r as OwnerShareMatcher, s as OwnerSharePolicyRegistration, t as OwnerSharePolicyRegistrationReceipt, u as OwnerSharePolicyV2, P as PortableDelegationImportReceipt, R as ReceiveOptions, v as RegisterOwnerSharePolicyParams, S as SenderShareKeyStorage, w as SenderShareRecord, x as SenderShareRecordStorage, y as SenderShareRevocationScope, z as SenderShareStore, A as ShareAccess, B as ShareAccessError, F as ShareAccessV2, G as ShareAction, J as ShareAddressedDelegationEnvelopeV2, K as ShareAddressedDelegationEnvelopeV2Schema, L as ShareAddressedDelegationRequestV2, N as ShareAddressedDelegationRequestV2Schema, Q as ShareAddressedDelegationResponseV2, T as ShareAddressedDelegationResponseV2Schema, U as ShareAddressedRecipientMatcher, V as ShareArtifactInput, W as ShareArtifactResult, X as ShareArtifactV2, Y as ShareCache, Z as ShareCacheEntry, _ as ShareCacheKey, $ as ShareCacheMetadata, a0 as ShareCapabilityLike, a1 as ShareConflict, a2 as ShareContentMetadata, a3 as ShareContentSource, a4 as ShareDelegationPreflight, a5 as ShareDeliveryAuthorizationV3Receipt, a6 as ShareDeliveryAuthorizationV3Request, a7 as ShareDeliveryRefusedError, a8 as ShareDetachedProof, a9 as ShareEnvelopeError, aa as ShareEnvelopeV2, ab as ShareExpiryBounds, ac as ShareKvContentSource, ad as ShareLinkLocation, ae as ShareListEntry, af as ShareListResult, ag as ShareNativeAction, ah as ShareNativeInvokeEnvelopeV1, ai as ShareNativeInvokeErrorResult, aj as ShareNativeInvokeInput, ak as ShareNativeInvokeResult, al as ShareNativeInvokeSuccessResult, am as ShareNativeResponse, an as ShareNativeResponseSchema, ao as SharePolicy, ap as SharePolicyBinding, aq as SharePolicySession, ar as SharePolicySessionV1, as as SharePolicySessionWireV1, at as SharePortableDelegation, au as ShareReadInvocationV1, av as ShareReadResult, aw as ShareRecipientClient, ax as ShareRecipientClientOptions, az as ShareRecipientPolicy, aB as ShareRecipientResult, aC as ShareRecipientTarget, aE as ShareResource, aG as ShareSaveOptions, aH as ShareSqlContentSource, aI as ShareWireAction, aJ as SharingService, aK as SharingServiceConfig, aL as SignedDelegation, bo as StoredDelegationChain, aM as VerifyShareEnvelopeOptions, aN as canonicalOwnerSharePolicy, aO as computeOwnerShareRegistrationCid, aP as computeShareCid, bp as createCapabilityKeyRegistry, aQ as createDelegatedShareKey, aR as createPolicyEnforcementDelegation, aS as createShareArtifact, aT as createShareArtifactAsync, aU as createSharePolicy, aV as createSharingService, aW as decryptShareBytesAsync, aX as delegatePortablePolicySession, aY as encodeInlineShareUrl, aZ as encodeShareArtifact, a_ as encodeShareUrl, a$ as encryptShareBytes, b0 as encryptShareBytesAsync, b1 as importPortableDelegation, b2 as intersectShareCapabilities, b3 as isV2ShareLink, b4 as normalizeShareActions, b5 as normalizeShareRecipientTarget, b6 as normalizeShareResource, b7 as parsePortableDelegation, b8 as parseShareArtifact, b9 as parseShareUrl, ba as restoreDelegatedShareKey, bb as serializePortableDelegation, bc as shareCapabilityAllows, bd as shortDeliveryLinkBodyCid, be as signShareEnvelope, bf as validateOwnerSharePolicyRegistration, bg as validateOwnerSharePolicyRegistrationBytes, bh as verifyShareCid, bi as verifyShareDeliveryAuthorizationV3Bytes, bj as verifyShareEnvelope, bk as withoutShareLink } from './recipient-types.schema-BIJcihno.cjs';
|
|
10
12
|
export { ACCOUNT_INDEX_SCHEMA, ACCOUNT_MANIFEST_PERMISSIONS, AGENTS_SPACE, BOOTSTRAP_ALLOWLIST, BOOTSTRAP_DEFAULT_ONLY_SESSION_REQUEST, BOOTSTRAP_DEFAULT_SPACE, BOOTSTRAP_ENCRYPTION_NETWORK_NAME, BOOTSTRAP_ENCRYPTION_NETWORK_RESOURCE_TEMPLATE, BOOTSTRAP_MANIFEST, BOOTSTRAP_PERSISTED_APPLICATION_MANIFESTS, BOOTSTRAP_PUBLIC_SPACE, BOOTSTRAP_SESSION_REQUESTS, BOOTSTRAP_SPACE_MANIFESTS, BOOTSTRAP_SPACE_NAMES, BootstrapAllowlistEntry, BootstrapAllowlistKind, BootstrapEncryptionNetworkStep, BootstrapManifest, BootstrapRawAbilityAllowlistEntry, BootstrapSchemaStep, BootstrapSeedApplicationsStep, BootstrapSeedSpacesStep, BootstrapSpaceDescriptor, BootstrapSpaceName, BootstrapSpaceStep, BootstrapStep, BootstrapStepKind, CAPABILITIES, CAPABILITY_REGISTRY, CapabilityRegistryEntry, CapabilityStatus, DUCKDB, ENCRYPTION, HOOKS, KV, SECRET_RECORDS_SCHEMA, SPACE, SQL, TINYCLOUD_ACCOUNT_SPACE_MANIFEST, TINYCLOUD_AGENTS_SPACE_MANIFEST, TINYCLOUD_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
|
|
11
13
|
export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BjzXwtNw.cjs';
|
|
12
14
|
export { SiweMessage } from 'siwe';
|
|
@@ -333,6 +335,14 @@ type ManifestSecretActions = true | string | string[] | {
|
|
|
333
335
|
expiry?: string;
|
|
334
336
|
description?: string;
|
|
335
337
|
};
|
|
338
|
+
type ManifestKeyAbility = "key.create" | "decrypt" | "key.block" | "key.unblock";
|
|
339
|
+
type ManifestKeyDeclaration = {
|
|
340
|
+
path: string;
|
|
341
|
+
abilities: ManifestKeyAbility[];
|
|
342
|
+
} | {
|
|
343
|
+
prefix: string;
|
|
344
|
+
abilities: ManifestKeyAbility[];
|
|
345
|
+
};
|
|
336
346
|
/**
|
|
337
347
|
* The valid values for `Manifest.defaults`.
|
|
338
348
|
*
|
|
@@ -362,6 +372,8 @@ interface Manifest {
|
|
|
362
372
|
manifest_version?: 1;
|
|
363
373
|
/** Application identifier / namespace prefix. Required. */
|
|
364
374
|
app_id: string;
|
|
375
|
+
/** App key namespace when it differs from app_id. */
|
|
376
|
+
keys_app_id?: string;
|
|
365
377
|
/** Display name. Required. */
|
|
366
378
|
name: string;
|
|
367
379
|
/** Description of what the app or delegate does. Optional. */
|
|
@@ -401,6 +413,8 @@ interface Manifest {
|
|
|
401
413
|
* the `secrets` space.
|
|
402
414
|
*/
|
|
403
415
|
secrets?: Record<string, ManifestSecretActions>;
|
|
416
|
+
/** Named keys on the app's default encryption network. */
|
|
417
|
+
keys?: ManifestKeyDeclaration[];
|
|
404
418
|
}
|
|
405
419
|
/**
|
|
406
420
|
* A resolved permission entry with fully-expanded paths and action URNs.
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { br as CredentialHolderBinding, bs as CredentialFlowDescriptor, bt as Cr
|
|
|
3
3
|
export { A as ATTESTED_ENFORCER_BINDING_V2_SCHEMA, b as AdmitPolicyCredentialV3Input, c as AdmitPolicyCredentialV4Input, d as AttestedEnforcerBindingV2, B as BuildPolicyCredentialPresentationV3Input, e as BuildPolicyCredentialPresentationV4Input, C as CONTENT_SOURCE_V1_DOMAIN, bz as CREDENTIAL_ACQUISITION_PROTOCOL, bA as CREDENTIAL_CONTRACT_VERSION, bB as CREDENTIAL_FORMAT, bz as CREDENTIAL_PROTOCOL, bC as CREDENTIAL_STEP_REGISTRY_VERSION, f as CompactPolicyDescendantInput, h as CompactUcanAuthorizationV1, bD as CredentialClaimDescriptor, bE as CredentialEndpointId, bF as CredentialInputDescriptor, bG as CredentialProgressEvent, bH as CredentialStepDescriptor, bI as CredentialStepType, bJ as CredentialUxState, E as ED25519_JCS_SIGNATURE_SUITE, i as EIP191_JCS_SIGNATURE_SUITE, bK as HOLDER_BINDING_DOMAIN, bL as IssuerVerificationKey, J as JsonObject, L as LAST_V2_CREATE_AT, j as LAST_V2_READ_AT, M as MAX_LEGACY_ENVELOPE_EXPIRES_AT, N as NATIVE_PROJECTION_V1_DOMAIN, k as POLICY_CAPABILITY_V1_DOMAIN, l as POLICY_CAPABILITY_V1_SCHEMA, m as POLICY_CREDENTIAL_REQUIREMENT_V1_TYPE, n as POLICY_ENFORCEMENT_DELEGATION_V2_SCHEMA, o as POLICY_ENGINE_RECORD_SCHEMA, p as POLICY_PRESENTATION_V3_DOMAIN, q as POLICY_PRESENTATION_V3_SCHEMA, r as POLICY_PRESENTATION_V4_DOMAIN, s as POLICY_PRESENTATION_V4_SCHEMA, t as POLICY_SCHEMA, u as POLICY_SESSION_UCAN_V1_PROFILE, v as POLICY_STATUS_SCHEMA, w as POLICY_V1_DOMAIN, x as POLICY_V1_SCHEMA, y as POLICY_V2_DOMAIN, z as POLICY_V2_SCHEMA, a as Policy, F as PolicyCredentialAdmissionV3, G as PolicyCredentialAdmissionV4, H as PolicyCredentialPresentationV3, I as PolicyCredentialPresentationV4, K as PolicyCredentialRequirementV1, P as PolicyEngineRecord, O as PolicyRootStatusV3, Q as PolicyRootV3, R as PolicySessionUcanFactV1, T as PolicySessionUcanV1, V as PolicyStatus, W as ROOT_REVOCATION_V1_DOMAIN, X as ROOT_REVOCATION_V1_SCHEMA, Y as ROOT_STATUS_CHECKPOINT_V1_SCHEMA, Z as ROOT_STATUS_RENEWAL_V1_DOMAIN, _ as ROOT_STATUS_V1_DOMAIN, $ as RegisterPolicyV3Input, a0 as RegisterPolicyV3Receipt, a1 as SignCompactUcanAuthorizationInput, a2 as SignCompactUcanRootAuthorizationInput, a3 as SignatureMaterialError, a4 as SignatureSuite, a5 as SignatureVerificationError, a6 as SignedObjectCanonicalizationError, a7 as SignedObjectDigestError, a8 as SignedObjectErrorCode, a9 as SignedObjectIdError, aa as SignedObjectKind, ab as SignedObjectMaterial, ac as SignedObjectProfileError, ad as SignedObjectSchemaError, ae as SignedObjectSignature, S as SignedObjectSigner, af as SignedObjectVerificationResult, ag as SignedPolicyObject, ah as SigningKeyBindingError, ai as UnifiedContentSource, aj as UnifiedEncryptionCapability, ak as UnifiedKvCapability, al as UnifiedNativeCapability, am as UnifiedPolicyCapability, an as UnifiedPolicyV1, ao as UnifiedPolicyV2, ap as UnifiedResourceSelector, aq as UnsignedPolicy, ar as UnsignedPolicyCredentialPresentationV4, U as UnsignedPolicyEngineRecord, as as UnsignedPolicyObject, at as UnsignedPolicyStatus, au as UnsignedUnifiedPolicyV2, av as UnsupportedSignatureSuiteError, aw as admitPolicyCredentialV3, ax as admitPolicyCredentialV4, ay as buildPolicyCredentialPresentationV3, az as buildPolicyCredentialPresentationV4, aA as canonicalizeSignedObjectUnsigned, aB as canonicalizeUnifiedPolicyCapability, aC as compactAttenuationContains, aD as contentSourceDigestHex, aE as createAndSignPolicy, aF as createAndSignPolicyEngineRecord, aG as createAndSignPolicyStatus, aH as createAndSignSignedObject, aK as deriveSignedObjectMaterial, aL as getPolicyRootStatusV3, aM as issuedCredentialEnvelopeFromVerified, aO as normalizeUnifiedPolicyCapability, aP as parseCompactUcanAuthorization, aQ as parsePolicySessionUcan, aR as parseSignedCompactUcanAttenuation, aS as policyCidFromCanonicalBytes, aT as policyDigestHex, aU as policyIdForDigestHex, aV as policyV2DigestHex, aW as projectUnifiedPolicyCapabilities, aX as projectUnifiedPolicyCapability, aY as registerPolicyV3, aZ as renewPolicyRootStatusV3, a$ as revokePolicyRootV3, b0 as signCompactPolicyDescendant, b1 as signCompactUcanAuthorization, b2 as signCompactUcanRootAuthorization, b3 as signPolicyCredentialPresentationV4, b4 as signedObjectIdFor, b5 as toSignedObjectError, b6 as unifiedNativeProjectionHashHex, b7 as unifiedPolicyCapabilityContains, b8 as unifiedPolicyCapabilityDigestHex, b9 as unifiedPolicyCapabilityFromNative, ba as validatePolicyCredentialRequirementV1, bb as validatePolicyEngineRecordSigned, bc as validatePolicyEngineRecordSignedShape, bd as validatePolicyEngineRecordUnsigned, be as validatePolicySigned, bf as validatePolicySignedShape, bg as validatePolicyStatusSigned, bh as validatePolicyStatusSignedShape, bi as validatePolicyStatusUnsigned, bj as validatePolicyUnsigned, bk as validateUnifiedPolicyV2, bl as verifyPolicy, bm as verifyPolicyEngineRecord, bn as verifyPolicyRootRevocationV3, bo as verifyPolicyRootStatusCheckpointV3, bp as verifyPolicyStatus, bq as verifySignedObject } from './credential-admission-7I_ymo-C.js';
|
|
4
4
|
export { canonicalEmailDomain, canonicalMailbox, isCanonicalEmailDomain, mailboxBelongsToDomain } from '@tinycloud/share-envelope';
|
|
5
5
|
import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, ServiceSession, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
|
|
6
|
-
export { AuthorityRefusal, AuthorizationVerdict, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, IStorageService, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVBatchReadResponse, KVChange, KVChangesAuthority, KVChangesOptions, KVChangesResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListPage, KVListResponse, KVPutOptions, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PinnedKey, PrefixedKVService, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedReplicationOptions, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_NEARLY_FULL_RATIO, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageFullHandler, StorageFullMonitor, StorageRejectionDetails, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, appSecretScope, authorizationVerdictOf, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, isStorageFullError, networkDiscoveryKey, ok, openWrappedKey, parseCapabilityResource, parseNetworkId, parseSecretCatalogKey, parseStorageRejection, parseStorageStatus, resolveSecretListPrefix, resolveSecretPath, serviceError, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validatedCapabilityOf, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
6
|
+
export { AuthorityRefusal, AuthorizationVerdict, BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DecryptTransportResponseError, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, IStorageService, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVBatchReadResponse, KVChange, KVChangesAuthority, KVChangesOptions, KVChangesResponse, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListPage, KVListResponse, KVPutOptions, KVReadThrough, KVReplicaHandle, KVReplicaSpec, KVReplicaStorage, KVReplicationController, KVReplicationDeps, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, LocalGetResult, LocalListResult, LocalReadMeta, LocalReplicaStatus, LocalSyncResult, MAX_SECRET_SCOPE_LENGTH, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, ParsedSecretCatalogKey, PendingWriteRecord, PendingWriteState, PendingWriteStore, PinnedKey, PrefixedKVService, PurgeTarget, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ReplicaAuthorityState, ReplicaCoverage, ReplicaDevice, ReplicaGatedHandle, ReplicaGrantInfo, ReplicaInspectedStatus, ReplicaLocalEraseOutcome, ReplicaPurgeError, ReplicaPurgeFailedEvent, ReplicaPurgeLocalCopyResult, ReplicaPurgeTrigger, ReplicaState, ReplicaStatusEntry, ReplicationAuthority, ReplicationControl, ReplicationEvent, ReplicationIdentity, ReplicationOptions, ReplicationPurgeReport, ReplicationReason, ReplicationScheduler, ResolvedReplicationOptions, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SECRET_SCOPE_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, STORAGE_FULL_MESSAGE, STORAGE_MANAGE_URL, STORAGE_NEARLY_FULL_RATIO, STORAGE_WRITE_TOO_LARGE_MESSAGE, SchemaInfo, SecretCatalogEntry, SecretPayload, SecretPutOptions, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, StorageAccountUsage, StorageFullEvent, StorageFullHandler, StorageFullMonitor, StorageRejectionDetails, StorageStatus, StorageStatusOptions, StorageUsage, StorageUsageState, SubscribeOptions, TC832_RESERVED_SCOPES, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultNetworkReadResult, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, appSecretScope, authorizationVerdictOf, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, isStorageFullError, networkDiscoveryKey, ok, openWrappedKey, parseCapabilityResource, parseNetworkId, parseSecretCatalogKey, parseStorageRejection, parseStorageStatus, resolveSecretListPrefix, resolveSecretPath, serviceError, storageUsageState, tinyCloudDebugLogger, validateEnvelope, validatedCapabilityOf, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
7
7
|
export { HOLDER_KEY_BINDING_PRESENTATION_SCHEMA, HolderKeyBindingPresentation, LISTEN_SQL_STATEMENT_CATALOG, ListenSqlStatementName, POLICY_ENGINE_CHALLENGE_REQUEST_SCHEMA, POLICY_ENGINE_CHALLENGE_RESPONSE_SCHEMA, POLICY_ENGINE_DENIAL_SCHEMA, POLICY_ENGINE_GRANT_PRESENTATION_DENIAL_CODES, POLICY_ENGINE_RESOLVE_REQUEST_SCHEMA, PORTABLE_DELEGATION_SCHEMA, PolicyEngineGrantPresentationDenialCode, PortableDelegation, REQUESTER_ENGINE_RETRY_ATTEMPTS, REQUESTER_ENGINE_RETRY_MAX_DELAY_MS, REQUESTER_NEAR_EXPIRY_SECONDS, RequesterEndpointResolution, RequesterHttpRequest, RequesterHttpResponse, RequesterInvocationCapability, RequesterSigningCapability, RequesterTransport, TranscriptRequester, TranscriptRequesterError, TranscriptRequesterErrorCode, TranscriptRequesterErrorState, TranscriptRequesterOptions, TranscriptRequesterReadKvResult, TranscriptRequesterReadSqlResult, createTranscriptRequester, deriveDelegationCid, parseNodeNativePortableDelegation } from './requester/index.js';
|
|
8
|
-
import {
|
|
9
|
-
export { b as AccountDelegationRecord, c as AccountDelegationResource, C as
|
|
8
|
+
import { h as Delegation, d as CreateDelegationParams, G as GenerateShareParams, v as ShareLink, y as SpaceInfo, a as AccountDelegationQueryOptions, A as AccountDelegationPage, r as DelegationRevocationReceipt } from './types.schema-BmN-OnCA.js';
|
|
9
|
+
export { b as AccountDelegationRecord, c as AccountDelegationResource, C as CapabilityEntry, e as CreateDelegationWasmParams, f as CreateDelegationWasmResult, g as DelegatedResource, i as DelegationApiResponse, j as DelegationChain, k as DelegationChainV2, l as DelegationDirection, D as DelegationError, m as DelegationErrorCode, n as DelegationErrorCodes, o as DelegationFilters, p as DelegationManagerConfig, q as DelegationRecord, R as DelegationResult, s as DelegationStatus, I as IngestOptions, J as JWK, K as KeyInfo, t as KeyProvider, u as KeyType, S as SessionInvocationSigner, w as ShareLinkData, x as ShareSchema, z as SpaceOwnership } from './types.schema-BmN-OnCA.js';
|
|
10
|
+
import { I as ICapabilityKeyRegistry, h as ISharingService, f as DelegationManager } from './recipient-types.schema-Ebi5aliq.js';
|
|
11
|
+
export { C as CREDENTIAL_INVITATION_REQUEST_DOMAIN, bl as CapabilityKeyRegistry, bm as CapabilityKeyRegistryErrorCode, bn as CapabilityKeyRegistryErrorCodes, a as CreateOwnerDelegationParams, b as CredentialInvitationRequest, D as DELIVERY_ADMISSION_DOMAIN, c as DelegateReceivedShareParams, d as DelegatedShareAccess, e as DelegatedShareKey, g as DeliveryAdmission, E as EncodedShareData, M as MAX_CONTENT_BYTES, i as MAX_SEALED_SHARE_CONTENT_BYTES, j as MAX_SHARE_ARTIFACT_BYTES, k as MAX_SHARE_CONTENT_BYTES, l as MemorySenderShareKeyStorage, m as MemorySenderShareRecordStorage, n as MemoryShareCache, O as OwnerDelegationPermission, o as OwnerDelegationReceipt, p as OwnerShareAction, q as OwnerShareDecryption, r as OwnerShareMatcher, s as OwnerSharePolicyRegistration, t as OwnerSharePolicyRegistrationReceipt, u as OwnerSharePolicyV2, P as PortableDelegationImportReceipt, R as ReceiveOptions, v as RegisterOwnerSharePolicyParams, S as SenderShareKeyStorage, w as SenderShareRecord, x as SenderShareRecordStorage, y as SenderShareRevocationScope, z as SenderShareStore, A as ShareAccess, B as ShareAccessError, F as ShareAccessV2, G as ShareAction, J as ShareAddressedDelegationEnvelopeV2, K as ShareAddressedDelegationEnvelopeV2Schema, L as ShareAddressedDelegationRequestV2, N as ShareAddressedDelegationRequestV2Schema, Q as ShareAddressedDelegationResponseV2, T as ShareAddressedDelegationResponseV2Schema, U as ShareAddressedRecipientMatcher, V as ShareArtifactInput, W as ShareArtifactResult, X as ShareArtifactV2, Y as ShareCache, Z as ShareCacheEntry, _ as ShareCacheKey, $ as ShareCacheMetadata, a0 as ShareCapabilityLike, a1 as ShareConflict, a2 as ShareContentMetadata, a3 as ShareContentSource, a4 as ShareDelegationPreflight, a5 as ShareDeliveryAuthorizationV3Receipt, a6 as ShareDeliveryAuthorizationV3Request, a7 as ShareDeliveryRefusedError, a8 as ShareDetachedProof, a9 as ShareEnvelopeError, aa as ShareEnvelopeV2, ab as ShareExpiryBounds, ac as ShareKvContentSource, ad as ShareLinkLocation, ae as ShareListEntry, af as ShareListResult, ag as ShareNativeAction, ah as ShareNativeInvokeEnvelopeV1, ai as ShareNativeInvokeErrorResult, aj as ShareNativeInvokeInput, ak as ShareNativeInvokeResult, al as ShareNativeInvokeSuccessResult, am as ShareNativeResponse, an as ShareNativeResponseSchema, ao as SharePolicy, ap as SharePolicyBinding, aq as SharePolicySession, ar as SharePolicySessionV1, as as SharePolicySessionWireV1, at as SharePortableDelegation, au as ShareReadInvocationV1, av as ShareReadResult, aw as ShareRecipientClient, ax as ShareRecipientClientOptions, az as ShareRecipientPolicy, aB as ShareRecipientResult, aC as ShareRecipientTarget, aE as ShareResource, aG as ShareSaveOptions, aH as ShareSqlContentSource, aI as ShareWireAction, aJ as SharingService, aK as SharingServiceConfig, aL as SignedDelegation, bo as StoredDelegationChain, aM as VerifyShareEnvelopeOptions, aN as canonicalOwnerSharePolicy, aO as computeOwnerShareRegistrationCid, aP as computeShareCid, bp as createCapabilityKeyRegistry, aQ as createDelegatedShareKey, aR as createPolicyEnforcementDelegation, aS as createShareArtifact, aT as createShareArtifactAsync, aU as createSharePolicy, aV as createSharingService, aW as decryptShareBytesAsync, aX as delegatePortablePolicySession, aY as encodeInlineShareUrl, aZ as encodeShareArtifact, a_ as encodeShareUrl, a$ as encryptShareBytes, b0 as encryptShareBytesAsync, b1 as importPortableDelegation, b2 as intersectShareCapabilities, b3 as isV2ShareLink, b4 as normalizeShareActions, b5 as normalizeShareRecipientTarget, b6 as normalizeShareResource, b7 as parsePortableDelegation, b8 as parseShareArtifact, b9 as parseShareUrl, ba as restoreDelegatedShareKey, bb as serializePortableDelegation, bc as shareCapabilityAllows, bd as shortDeliveryLinkBodyCid, be as signShareEnvelope, bf as validateOwnerSharePolicyRegistration, bg as validateOwnerSharePolicyRegistrationBytes, bh as verifyShareCid, bi as verifyShareDeliveryAuthorizationV3Bytes, bj as verifyShareEnvelope, bk as withoutShareLink } from './recipient-types.schema-Ebi5aliq.js';
|
|
10
12
|
export { ACCOUNT_INDEX_SCHEMA, ACCOUNT_MANIFEST_PERMISSIONS, AGENTS_SPACE, BOOTSTRAP_ALLOWLIST, BOOTSTRAP_DEFAULT_ONLY_SESSION_REQUEST, BOOTSTRAP_DEFAULT_SPACE, BOOTSTRAP_ENCRYPTION_NETWORK_NAME, BOOTSTRAP_ENCRYPTION_NETWORK_RESOURCE_TEMPLATE, BOOTSTRAP_MANIFEST, BOOTSTRAP_PERSISTED_APPLICATION_MANIFESTS, BOOTSTRAP_PUBLIC_SPACE, BOOTSTRAP_SESSION_REQUESTS, BOOTSTRAP_SPACE_MANIFESTS, BOOTSTRAP_SPACE_NAMES, BootstrapAllowlistEntry, BootstrapAllowlistKind, BootstrapEncryptionNetworkStep, BootstrapManifest, BootstrapRawAbilityAllowlistEntry, BootstrapSchemaStep, BootstrapSeedApplicationsStep, BootstrapSeedSpacesStep, BootstrapSpaceDescriptor, BootstrapSpaceName, BootstrapSpaceStep, BootstrapStep, BootstrapStepKind, CAPABILITIES, CAPABILITY_REGISTRY, CapabilityRegistryEntry, CapabilityStatus, DUCKDB, ENCRYPTION, HOOKS, KV, SECRET_RECORDS_SCHEMA, SPACE, SQL, TINYCLOUD_ACCOUNT_SPACE_MANIFEST, TINYCLOUD_AGENTS_SPACE_MANIFEST, TINYCLOUD_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
|
|
11
13
|
export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-BjzXwtNw.js';
|
|
12
14
|
export { SiweMessage } from 'siwe';
|
|
@@ -333,6 +335,14 @@ type ManifestSecretActions = true | string | string[] | {
|
|
|
333
335
|
expiry?: string;
|
|
334
336
|
description?: string;
|
|
335
337
|
};
|
|
338
|
+
type ManifestKeyAbility = "key.create" | "decrypt" | "key.block" | "key.unblock";
|
|
339
|
+
type ManifestKeyDeclaration = {
|
|
340
|
+
path: string;
|
|
341
|
+
abilities: ManifestKeyAbility[];
|
|
342
|
+
} | {
|
|
343
|
+
prefix: string;
|
|
344
|
+
abilities: ManifestKeyAbility[];
|
|
345
|
+
};
|
|
336
346
|
/**
|
|
337
347
|
* The valid values for `Manifest.defaults`.
|
|
338
348
|
*
|
|
@@ -362,6 +372,8 @@ interface Manifest {
|
|
|
362
372
|
manifest_version?: 1;
|
|
363
373
|
/** Application identifier / namespace prefix. Required. */
|
|
364
374
|
app_id: string;
|
|
375
|
+
/** App key namespace when it differs from app_id. */
|
|
376
|
+
keys_app_id?: string;
|
|
365
377
|
/** Display name. Required. */
|
|
366
378
|
name: string;
|
|
367
379
|
/** Description of what the app or delegate does. Optional. */
|
|
@@ -401,6 +413,8 @@ interface Manifest {
|
|
|
401
413
|
* the `secrets` space.
|
|
402
414
|
*/
|
|
403
415
|
secrets?: Record<string, ManifestSecretActions>;
|
|
416
|
+
/** Named keys on the app's default encryption network. */
|
|
417
|
+
keys?: ManifestKeyDeclaration[];
|
|
404
418
|
}
|
|
405
419
|
/**
|
|
406
420
|
* A resolved permission entry with fully-expanded paths and action URNs.
|
package/dist/index.js
CHANGED
|
@@ -6177,7 +6177,11 @@ var DelegationErrorCodes = {
|
|
|
6177
6177
|
KV_SERVICE_UNAVAILABLE: "KV_SERVICE_UNAVAILABLE",
|
|
6178
6178
|
DATA_FETCH_FAILED: "DATA_FETCH_FAILED",
|
|
6179
6179
|
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
6180
|
-
UNSUPPORTED_OPERATION: "UNSUPPORTED_OPERATION"
|
|
6180
|
+
UNSUPPORTED_OPERATION: "UNSUPPORTED_OPERATION",
|
|
6181
|
+
/** The node answered 503: the delegation chain is too deep to evaluate right now. Retry later. */
|
|
6182
|
+
CHAIN_TOO_DEEP: "CHAIN_TOO_DEEP",
|
|
6183
|
+
/** The node answered 400 "invalid delegation query cursor": malformed, foreign or from another filter. Start the listing again without it. */
|
|
6184
|
+
INVALID_CURSOR: "INVALID_CURSOR"
|
|
6181
6185
|
};
|
|
6182
6186
|
var DelegationSchema = z4.object({
|
|
6183
6187
|
/** Content identifier (CID) of the delegation */
|
|
@@ -6254,7 +6258,7 @@ var AccountDelegationPageSchema = z4.object({
|
|
|
6254
6258
|
nextCursor: z4.string().optional()
|
|
6255
6259
|
}).strict();
|
|
6256
6260
|
var AccountDelegationQueryOptionsSchema = z4.object({
|
|
6257
|
-
direction: z4.enum(["granted", "received", "all"]).optional(),
|
|
6261
|
+
direction: z4.enum(["granted", "received", "all", "issued"]).optional(),
|
|
6258
6262
|
status: z4.enum(["active", "pending", "expired", "revoked", "ancestor_revoked"]).optional(),
|
|
6259
6263
|
space: z4.string().trim().min(1).optional(),
|
|
6260
6264
|
limit: z4.number().int().min(1).max(100).optional(),
|
|
@@ -6440,6 +6444,8 @@ var DelegationManagerConfigSchema = z4.object({
|
|
|
6440
6444
|
).optional(),
|
|
6441
6445
|
/** Optional owner-signed authorization for direct CID revocation */
|
|
6442
6446
|
signOwnerRevocation: z4.custom().optional(),
|
|
6447
|
+
/** Optional signer for proofless invocations by the session's own did:key (issued-delegation list and revoke) */
|
|
6448
|
+
sessionInvocationSigner: z4.custom().optional(),
|
|
6443
6449
|
/** Optional custom fetch implementation */
|
|
6444
6450
|
fetch: z4.unknown().refine(
|
|
6445
6451
|
(val) => val === void 0 || typeof val === "function",
|
|
@@ -6535,7 +6541,7 @@ var CreateDelegationWasmResultSchema = z4.object({
|
|
|
6535
6541
|
resources: z4.array(DelegatedResourceSchema)
|
|
6536
6542
|
});
|
|
6537
6543
|
|
|
6538
|
-
// src/delegations/
|
|
6544
|
+
// src/delegations/shared.ts
|
|
6539
6545
|
var DelegationAction = {
|
|
6540
6546
|
REVOKE: "tinycloud.delegation/revoke",
|
|
6541
6547
|
STATUS: "tinycloud.delegation/status",
|
|
@@ -6552,6 +6558,8 @@ function createError(code3, message, cause, meta) {
|
|
|
6552
6558
|
meta
|
|
6553
6559
|
};
|
|
6554
6560
|
}
|
|
6561
|
+
|
|
6562
|
+
// src/delegations/DelegationManager.ts
|
|
6555
6563
|
async function readInvokedJson(response, action) {
|
|
6556
6564
|
const text3 = await response.text();
|
|
6557
6565
|
if (text3.trim() === "") {
|
|
@@ -6574,11 +6582,13 @@ var DelegationManager = class {
|
|
|
6574
6582
|
* @param config - Configuration including hosts, session, and invoke function
|
|
6575
6583
|
*/
|
|
6576
6584
|
constructor(config) {
|
|
6585
|
+
this.issuedState = { issuedQuerySupported: false };
|
|
6577
6586
|
this.hosts = config.hosts;
|
|
6578
6587
|
this.session = config.session;
|
|
6579
6588
|
this.invoke = config.invoke;
|
|
6580
6589
|
this.invokeAny = config.invokeAny;
|
|
6581
6590
|
this.signOwnerRevocation = config.signOwnerRevocation;
|
|
6591
|
+
this.sessionInvocationSigner = config.sessionInvocationSigner;
|
|
6582
6592
|
this.fetchFn = config.fetch ?? globalThis.fetch.bind(globalThis);
|
|
6583
6593
|
this.accountSpaceId = config.accountSpaceId;
|
|
6584
6594
|
}
|
|
@@ -6801,8 +6811,14 @@ var DelegationManager = class {
|
|
|
6801
6811
|
};
|
|
6802
6812
|
}
|
|
6803
6813
|
}
|
|
6804
|
-
/**
|
|
6805
|
-
|
|
6814
|
+
/**
|
|
6815
|
+
* Query lifecycle-complete delegation history for the authenticated account.
|
|
6816
|
+
*
|
|
6817
|
+
* `scope.spaces` lists the spaces to sign `tinycloud.delegation/list` for, in order. Omitted, the
|
|
6818
|
+
* account space is tried, then the session's own space. A caller that knows which of them the session
|
|
6819
|
+
* holds passes only those; an empty list sends nothing and answers PERMISSION_DENIED.
|
|
6820
|
+
*/
|
|
6821
|
+
async query(options2 = {}, scope = {}) {
|
|
6806
6822
|
const validated = AccountDelegationQueryOptionsSchema.safeParse(options2);
|
|
6807
6823
|
if (!validated.success) {
|
|
6808
6824
|
return {
|
|
@@ -6815,6 +6831,7 @@ var DelegationManager = class {
|
|
|
6815
6831
|
)
|
|
6816
6832
|
};
|
|
6817
6833
|
}
|
|
6834
|
+
if (validated.data.direction === "issued") return this.queryIssued(validated.data);
|
|
6818
6835
|
if (!this.invokeAny) {
|
|
6819
6836
|
return {
|
|
6820
6837
|
ok: false,
|
|
@@ -6836,7 +6853,7 @@ var DelegationManager = class {
|
|
|
6836
6853
|
}
|
|
6837
6854
|
try {
|
|
6838
6855
|
let response;
|
|
6839
|
-
for (const spaceId of
|
|
6856
|
+
for (const spaceId of new Set(scope.spaces ?? [accountSpaceId, this.session.spaceId])) {
|
|
6840
6857
|
const headers = Object.fromEntries(new Headers(this.invokeAny(this.session, [{
|
|
6841
6858
|
spaceId,
|
|
6842
6859
|
service: "delegation",
|
|
@@ -6896,6 +6913,45 @@ var DelegationManager = class {
|
|
|
6896
6913
|
};
|
|
6897
6914
|
}
|
|
6898
6915
|
}
|
|
6916
|
+
/** The state the lazily loaded issued-delegation module reads and updates. */
|
|
6917
|
+
issuedContext() {
|
|
6918
|
+
return {
|
|
6919
|
+
host: this.host,
|
|
6920
|
+
fetchFn: this.fetchFn,
|
|
6921
|
+
sessionInvocationSigner: this.sessionInvocationSigner,
|
|
6922
|
+
state: this.issuedState
|
|
6923
|
+
};
|
|
6924
|
+
}
|
|
6925
|
+
/**
|
|
6926
|
+
* Lists the delegations this session's own key issued (`direction: "issued"`).
|
|
6927
|
+
* The implementation loads on first use.
|
|
6928
|
+
*/
|
|
6929
|
+
async queryIssued(options2) {
|
|
6930
|
+
const issued = await import("@tinycloud/sdk-core/delegations/issued");
|
|
6931
|
+
return issued.queryIssued(this.issuedContext(), options2);
|
|
6932
|
+
}
|
|
6933
|
+
/**
|
|
6934
|
+
* Every delegation this session's key issued, following `nextCursor` until
|
|
6935
|
+
* it is absent. `maxItems` stops early once that many are collected;
|
|
6936
|
+
* `untilCid` stops after the page that contains that delegation. Items come
|
|
6937
|
+
* in CID order (each carries `issuedAt`). The implementation loads on first use.
|
|
6938
|
+
*/
|
|
6939
|
+
async queryAllIssued(options2 = {}) {
|
|
6940
|
+
const issued = await import("@tinycloud/sdk-core/delegations/issued");
|
|
6941
|
+
return issued.queryAllIssued((page) => this.query(page), options2);
|
|
6942
|
+
}
|
|
6943
|
+
/**
|
|
6944
|
+
* Revokes a delegation this session's key issued, with no proof: a UCAN
|
|
6945
|
+
* signed by the session's own did:key carrying `urn:cid:<cid>` and
|
|
6946
|
+
* `tinycloud.delegation/revoke`. Revoking a delegation that is already revoked
|
|
6947
|
+
* succeeds. A refusal (the key is not the delegator) carries the node's
|
|
6948
|
+
* message; 503 means the chain is too deep right now, retry later.
|
|
6949
|
+
* The implementation loads on first use.
|
|
6950
|
+
*/
|
|
6951
|
+
async revokeIssued(cid2) {
|
|
6952
|
+
const issued = await import("@tinycloud/sdk-core/delegations/issued");
|
|
6953
|
+
return issued.revokeIssued(this.issuedContext(), cid2);
|
|
6954
|
+
}
|
|
6899
6955
|
/**
|
|
6900
6956
|
* Gets the full delegation chain for a given delegation.
|
|
6901
6957
|
*
|
|
@@ -7202,7 +7258,7 @@ function validateEncodedShareData(data) {
|
|
|
7202
7258
|
// src/manifest.ts
|
|
7203
7259
|
import ms from "ms";
|
|
7204
7260
|
import { ACCOUNT_MANIFEST_PERMISSIONS } from "@tinycloud/bootstrap";
|
|
7205
|
-
import { resolveSecretPath, SECRET_NAME_RE } from "@tinycloud/sdk-services";
|
|
7261
|
+
import { resolveSecretPath, SECRET_NAME_RE, parseNetworkId } from "@tinycloud/sdk-services";
|
|
7206
7262
|
var DEFAULT_KNOWLEDGE_ROOT = "knowledge/index.md";
|
|
7207
7263
|
var ManifestValidationError = class extends Error {
|
|
7208
7264
|
constructor(message) {
|
|
@@ -7325,6 +7381,14 @@ function expandEncryptionPermissionEntry(entry) {
|
|
|
7325
7381
|
`tinycloud.encryption entries require path to be a networkId URN (got ${JSON.stringify(entry.path)})`
|
|
7326
7382
|
);
|
|
7327
7383
|
}
|
|
7384
|
+
if (entry.path.includes("/")) {
|
|
7385
|
+
throw new ManifestValidationError("named keys go in manifest.keys");
|
|
7386
|
+
}
|
|
7387
|
+
try {
|
|
7388
|
+
parseNetworkId(entry.path);
|
|
7389
|
+
} catch {
|
|
7390
|
+
throw new ManifestValidationError("tinycloud.encryption entries require a valid networkId URN");
|
|
7391
|
+
}
|
|
7328
7392
|
const normalizedActions = [];
|
|
7329
7393
|
for (const action of entry.actions) {
|
|
7330
7394
|
if (action === "decrypt" || action === "tinycloud.encryption/decrypt") {
|
|
@@ -7449,8 +7513,56 @@ function validateManifest(input) {
|
|
|
7449
7513
|
if (m.secrets !== void 0) {
|
|
7450
7514
|
validateManifestSecrets(m.secrets);
|
|
7451
7515
|
}
|
|
7516
|
+
if (Object.prototype.hasOwnProperty.call(m, "keys_app_id") && (typeof m.keys_app_id !== "string" || !KEY_APP_ID.test(m.keys_app_id))) {
|
|
7517
|
+
throw new ManifestValidationError("manifest.keys_app_id is invalid");
|
|
7518
|
+
}
|
|
7519
|
+
validateManifestKeys(m.keys_app_id ?? m.app_id, m.keys);
|
|
7452
7520
|
return m;
|
|
7453
7521
|
}
|
|
7522
|
+
var KEY_SEGMENT = "[a-z0-9][a-z0-9._-]{0,63}";
|
|
7523
|
+
var KEY_APP_ID = new RegExp(`^${KEY_SEGMENT}$`);
|
|
7524
|
+
var KEY_PATH = new RegExp(`^${KEY_SEGMENT}(?:/${KEY_SEGMENT}){2,7}$`);
|
|
7525
|
+
var KEY_ABILITIES = ["key.create", "decrypt", "key.block", "key.unblock"];
|
|
7526
|
+
function validateManifestKeys(appId, keys) {
|
|
7527
|
+
if (keys === void 0) return;
|
|
7528
|
+
if (!Array.isArray(keys) || keys.length > 32) {
|
|
7529
|
+
throw new ManifestValidationError("manifest.keys must contain at most 32 entries");
|
|
7530
|
+
}
|
|
7531
|
+
if (keys.length === 0) return;
|
|
7532
|
+
if (!KEY_APP_ID.test(appId)) {
|
|
7533
|
+
throw new ManifestValidationError("manifest.keys requires a valid app_id");
|
|
7534
|
+
}
|
|
7535
|
+
const paths = /* @__PURE__ */ new Set();
|
|
7536
|
+
let prefixSeen = false;
|
|
7537
|
+
for (const [index, value] of keys.entries()) {
|
|
7538
|
+
const label = `manifest.keys[${index}]`;
|
|
7539
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) {
|
|
7540
|
+
throw new ManifestValidationError(`${label} must be an object`);
|
|
7541
|
+
}
|
|
7542
|
+
const entry = value;
|
|
7543
|
+
const fields = Object.keys(entry);
|
|
7544
|
+
const hasPath = Object.prototype.hasOwnProperty.call(entry, "path");
|
|
7545
|
+
const hasPrefix = Object.prototype.hasOwnProperty.call(entry, "prefix");
|
|
7546
|
+
if (hasPath === hasPrefix || fields.some((field) => !["path", "prefix", "abilities"].includes(field))) {
|
|
7547
|
+
throw new ManifestValidationError(`${label} must have one path or prefix and abilities`);
|
|
7548
|
+
}
|
|
7549
|
+
if (!Array.isArray(entry.abilities) || entry.abilities.length === 0 || new Set(entry.abilities).size !== entry.abilities.length || entry.abilities.some((ability) => typeof ability !== "string" || !KEY_ABILITIES.includes(ability))) {
|
|
7550
|
+
throw new ManifestValidationError(`${label}.abilities is invalid`);
|
|
7551
|
+
}
|
|
7552
|
+
if (hasPath) {
|
|
7553
|
+
const path = entry.path;
|
|
7554
|
+
if (typeof path !== "string" || path.length > 255 || !KEY_PATH.test(path) || !path.startsWith(`apps/${appId}/`) || paths.has(path)) {
|
|
7555
|
+
throw new ManifestValidationError(`${label}.path is invalid`);
|
|
7556
|
+
}
|
|
7557
|
+
paths.add(path);
|
|
7558
|
+
} else {
|
|
7559
|
+
if (entry.prefix !== `apps/${appId}/` || prefixSeen) {
|
|
7560
|
+
throw new ManifestValidationError(`${label}.prefix is invalid`);
|
|
7561
|
+
}
|
|
7562
|
+
prefixSeen = true;
|
|
7563
|
+
}
|
|
7564
|
+
}
|
|
7565
|
+
}
|
|
7454
7566
|
function resolveManifestKnowledgeRoot(knowledge) {
|
|
7455
7567
|
if (knowledge === void 0) {
|
|
7456
7568
|
return void 0;
|
|
@@ -12242,15 +12354,15 @@ function markDelegationTerminal(token, key) {
|
|
|
12242
12354
|
// src/networkId.ts
|
|
12243
12355
|
import {
|
|
12244
12356
|
buildNetworkId,
|
|
12245
|
-
parseNetworkId
|
|
12357
|
+
parseNetworkId as parseNetworkId2
|
|
12246
12358
|
} from "@tinycloud/sdk-services";
|
|
12247
12359
|
function canonicalizeNetworkId(networkId) {
|
|
12248
|
-
const parsed =
|
|
12360
|
+
const parsed = parseNetworkId2(networkId);
|
|
12249
12361
|
return buildNetworkId(canonicalizeDid(parsed.ownerDid), parsed.name);
|
|
12250
12362
|
}
|
|
12251
12363
|
function parseCanonicalNetworkId(networkId) {
|
|
12252
12364
|
const canonical = canonicalizeNetworkId(networkId);
|
|
12253
|
-
return
|
|
12365
|
+
return parseNetworkId2(canonical);
|
|
12254
12366
|
}
|
|
12255
12367
|
|
|
12256
12368
|
// src/storage.schema.ts
|
|
@@ -15063,7 +15175,7 @@ import {
|
|
|
15063
15175
|
resolveSecretPath as resolveSecretPath2,
|
|
15064
15176
|
EncryptionService,
|
|
15065
15177
|
DecryptTransportResponseError,
|
|
15066
|
-
parseNetworkId as
|
|
15178
|
+
parseNetworkId as parseNetworkId3,
|
|
15067
15179
|
buildNetworkId as buildNetworkId2,
|
|
15068
15180
|
isNetworkId,
|
|
15069
15181
|
networkDiscoveryKey,
|
|
@@ -19888,7 +20000,7 @@ export {
|
|
|
19888
20000
|
parseCapabilityResource,
|
|
19889
20001
|
parseCompactUcanAuthorization,
|
|
19890
20002
|
parseExpiry,
|
|
19891
|
-
|
|
20003
|
+
parseNetworkId3 as parseNetworkId,
|
|
19892
20004
|
parseNodeNativePortableDelegation,
|
|
19893
20005
|
parsePkhDid,
|
|
19894
20006
|
parsePolicySessionUcan,
|