@tinycloud/sdk-core 2.6.3-beta.0 → 2.7.0-beta.2
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/capability-Dbx-xqUh.d.cts +46 -0
- package/dist/capability-Dbx-xqUh.d.ts +46 -0
- package/dist/index.cjs +4024 -440
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +144 -21
- package/dist/index.d.ts +144 -21
- package/dist/index.js +3939 -410
- package/dist/index.js.map +1 -1
- package/dist/policy/index.cjs +2166 -0
- package/dist/policy/index.cjs.map +1 -0
- package/dist/policy/index.d.cts +94 -0
- package/dist/policy/index.d.ts +94 -0
- package/dist/policy/index.js +2087 -0
- package/dist/policy/index.js.map +1 -0
- package/dist/requester/index.cjs +2912 -0
- package/dist/requester/index.cjs.map +1 -0
- package/dist/requester/index.d.cts +229 -0
- package/dist/requester/index.d.ts +229 -0
- package/dist/requester/index.js +2871 -0
- package/dist/requester/index.js.map +1 -0
- package/dist/signed-object-C9Gur3ZY.d.ts +149 -0
- package/dist/signed-object-Cy_81K45.d.cts +149 -0
- package/package.json +13 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
|
|
3
3
|
export { 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, 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, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, 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, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
4
|
+
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';
|
|
4
5
|
export { ACCOUNT_INDEX_SCHEMA, BOOTSTRAP_ALLOWLIST, 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_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
|
|
6
|
+
export { E as ED25519_JCS_SIGNATURE_SUITE, b as EIP191_JCS_SIGNATURE_SUITE, J as JsonObject, c as POLICY_ENGINE_RECORD_SCHEMA, d as POLICY_SCHEMA, e as POLICY_STATUS_SCHEMA, a as Policy, P as PolicyEngineRecord, f as PolicyStatus, g as SignatureMaterialError, h as SignatureSuite, i as SignatureVerificationError, j as SignedObjectCanonicalizationError, k as SignedObjectDigestError, l as SignedObjectErrorCode, m as SignedObjectIdError, n as SignedObjectKind, o as SignedObjectMaterial, p as SignedObjectProfileError, q as SignedObjectSchemaError, r as SignedObjectSignature, S as SignedObjectSigner, s as SignedObjectVerificationResult, t as SignedPolicyObject, u as SigningKeyBindingError, v as UnsignedPolicy, U as UnsignedPolicyEngineRecord, w as UnsignedPolicyObject, x as UnsignedPolicyStatus, y as UnsupportedSignatureSuiteError, z as canonicalizeSignedObjectUnsigned, A as createAndSignPolicy, B as createAndSignPolicyEngineRecord, C as createAndSignPolicyStatus, D as createAndSignSignedObject, F as deriveSignedObjectMaterial, G as signedObjectIdFor, H as toSignedObjectError, I as validatePolicyEngineRecordSigned, K as validatePolicyEngineRecordSignedShape, L as validatePolicyEngineRecordUnsigned, M as validatePolicySigned, N as validatePolicySignedShape, O as validatePolicyStatusSigned, Q as validatePolicyStatusSignedShape, R as validatePolicyStatusUnsigned, T as validatePolicyUnsigned, V as verifyPolicy, W as verifyPolicyEngineRecord, X as verifyPolicyStatus, Y as verifySignedObject } from './signed-object-Cy_81K45.cjs';
|
|
7
|
+
export { a as JsonValue, j as jcsCanonicalize, n as normalizeJson, s as serializeJcsJson } from './capability-Dbx-xqUh.cjs';
|
|
5
8
|
export { SiweMessage } from 'siwe';
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -659,8 +662,8 @@ interface SubsetCheckResult {
|
|
|
659
662
|
* - If `granted.path` ends with `/`, it covers any `requested.path` that
|
|
660
663
|
* starts with `granted.path`.
|
|
661
664
|
* - Otherwise, the paths must match exactly.
|
|
662
|
-
* - Action containment: every URN
|
|
663
|
-
*
|
|
665
|
+
* - Action containment: every requested URN must be matched exactly or by a
|
|
666
|
+
* service-scoped wildcard such as `tinycloud.kv/*`.
|
|
664
667
|
*
|
|
665
668
|
* Any `requested` entry that does not find a matching `granted` entry is
|
|
666
669
|
* added to `missing` and the overall result is non-subset.
|
|
@@ -670,6 +673,8 @@ interface SubsetCheckResult {
|
|
|
670
673
|
* or `expandActionShortNames` to normalize inputs first.
|
|
671
674
|
*/
|
|
672
675
|
declare function isCapabilitySubset(requested: readonly PermissionEntry[], granted: readonly PermissionEntry[]): SubsetCheckResult;
|
|
676
|
+
/** Return whether a granted action pattern covers one requested action. */
|
|
677
|
+
declare function actionContains(grantedAction: string, requestedAction: string): boolean;
|
|
673
678
|
/**
|
|
674
679
|
* The raw shape returned from the WASM `parseRecapFromSiwe` export. The
|
|
675
680
|
* Rust layer encodes the service in the short form (e.g. `"kv"`) because
|
|
@@ -891,19 +896,19 @@ declare const PersistedTinyCloudSessionSchema: z.ZodObject<{
|
|
|
891
896
|
/** The verification method DID */
|
|
892
897
|
verificationMethod: z.ZodString;
|
|
893
898
|
}, "strip", z.ZodTypeAny, {
|
|
899
|
+
spaceId: string;
|
|
894
900
|
delegationHeader: {
|
|
895
901
|
Authorization: string;
|
|
896
902
|
};
|
|
897
903
|
delegationCid: string;
|
|
898
|
-
spaceId: string;
|
|
899
904
|
verificationMethod: string;
|
|
900
905
|
spaces?: Record<string, string> | undefined;
|
|
901
906
|
}, {
|
|
907
|
+
spaceId: string;
|
|
902
908
|
delegationHeader: {
|
|
903
909
|
Authorization: string;
|
|
904
910
|
};
|
|
905
911
|
delegationCid: string;
|
|
906
|
-
spaceId: string;
|
|
907
912
|
verificationMethod: string;
|
|
908
913
|
spaces?: Record<string, string> | undefined;
|
|
909
914
|
}>;
|
|
@@ -943,19 +948,19 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
943
948
|
/** The verification method DID */
|
|
944
949
|
verificationMethod: z.ZodString;
|
|
945
950
|
}, "strip", z.ZodTypeAny, {
|
|
951
|
+
spaceId: string;
|
|
946
952
|
delegationHeader: {
|
|
947
953
|
Authorization: string;
|
|
948
954
|
};
|
|
949
955
|
delegationCid: string;
|
|
950
|
-
spaceId: string;
|
|
951
956
|
verificationMethod: string;
|
|
952
957
|
spaces?: Record<string, string> | undefined;
|
|
953
958
|
}, {
|
|
959
|
+
spaceId: string;
|
|
954
960
|
delegationHeader: {
|
|
955
961
|
Authorization: string;
|
|
956
962
|
};
|
|
957
963
|
delegationCid: string;
|
|
958
|
-
spaceId: string;
|
|
959
964
|
verificationMethod: string;
|
|
960
965
|
spaces?: Record<string, string> | undefined;
|
|
961
966
|
}>>;
|
|
@@ -992,19 +997,19 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
992
997
|
sessionKey: string;
|
|
993
998
|
siwe: string;
|
|
994
999
|
signature: string;
|
|
995
|
-
expiresAt: string;
|
|
996
1000
|
createdAt: string;
|
|
1001
|
+
expiresAt: string;
|
|
997
1002
|
version: string;
|
|
998
1003
|
ens?: {
|
|
999
1004
|
domain?: string | null | undefined;
|
|
1000
1005
|
avatarUrl?: string | null | undefined;
|
|
1001
1006
|
} | undefined;
|
|
1002
1007
|
tinycloudSession?: {
|
|
1008
|
+
spaceId: string;
|
|
1003
1009
|
delegationHeader: {
|
|
1004
1010
|
Authorization: string;
|
|
1005
1011
|
};
|
|
1006
1012
|
delegationCid: string;
|
|
1007
|
-
spaceId: string;
|
|
1008
1013
|
verificationMethod: string;
|
|
1009
1014
|
spaces?: Record<string, string> | undefined;
|
|
1010
1015
|
} | undefined;
|
|
@@ -1015,19 +1020,19 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
1015
1020
|
sessionKey: string;
|
|
1016
1021
|
siwe: string;
|
|
1017
1022
|
signature: string;
|
|
1018
|
-
expiresAt: string;
|
|
1019
1023
|
createdAt: string;
|
|
1024
|
+
expiresAt: string;
|
|
1020
1025
|
version: string;
|
|
1021
1026
|
ens?: {
|
|
1022
1027
|
domain?: string | null | undefined;
|
|
1023
1028
|
avatarUrl?: string | null | undefined;
|
|
1024
1029
|
} | undefined;
|
|
1025
1030
|
tinycloudSession?: {
|
|
1031
|
+
spaceId: string;
|
|
1026
1032
|
delegationHeader: {
|
|
1027
1033
|
Authorization: string;
|
|
1028
1034
|
};
|
|
1029
1035
|
delegationCid: string;
|
|
1030
|
-
spaceId: string;
|
|
1031
1036
|
verificationMethod: string;
|
|
1032
1037
|
spaces?: Record<string, string> | undefined;
|
|
1033
1038
|
} | undefined;
|
|
@@ -1074,11 +1079,11 @@ declare const TinyCloudSessionSchema: z.ZodObject<{
|
|
|
1074
1079
|
sessionKey: string;
|
|
1075
1080
|
siwe: string;
|
|
1076
1081
|
signature: string;
|
|
1082
|
+
spaceId: string;
|
|
1077
1083
|
delegationHeader: {
|
|
1078
1084
|
Authorization: string;
|
|
1079
1085
|
};
|
|
1080
1086
|
delegationCid: string;
|
|
1081
|
-
spaceId: string;
|
|
1082
1087
|
verificationMethod: string;
|
|
1083
1088
|
jwk: {} & {
|
|
1084
1089
|
[k: string]: unknown;
|
|
@@ -1090,11 +1095,11 @@ declare const TinyCloudSessionSchema: z.ZodObject<{
|
|
|
1090
1095
|
sessionKey: string;
|
|
1091
1096
|
siwe: string;
|
|
1092
1097
|
signature: string;
|
|
1098
|
+
spaceId: string;
|
|
1093
1099
|
delegationHeader: {
|
|
1094
1100
|
Authorization: string;
|
|
1095
1101
|
};
|
|
1096
1102
|
delegationCid: string;
|
|
1097
|
-
spaceId: string;
|
|
1098
1103
|
verificationMethod: string;
|
|
1099
1104
|
jwk: {} & {
|
|
1100
1105
|
[k: string]: unknown;
|
|
@@ -1459,6 +1464,44 @@ declare const DelegationSchema: z.ZodObject<{
|
|
|
1459
1464
|
authHeader?: string | undefined;
|
|
1460
1465
|
}>;
|
|
1461
1466
|
type Delegation = z.infer<typeof DelegationSchema>;
|
|
1467
|
+
/** Node-confirmed lifecycle state for one delegation. */
|
|
1468
|
+
declare const DelegationStatusSchema: z.ZodEffects<z.ZodObject<{
|
|
1469
|
+
cid: z.ZodString;
|
|
1470
|
+
status: z.ZodEnum<["active", "revoked", "expired", "unavailable", "not_found"]>;
|
|
1471
|
+
exists: z.ZodBoolean;
|
|
1472
|
+
active: z.ZodBoolean;
|
|
1473
|
+
revoked: z.ZodBoolean;
|
|
1474
|
+
expired: z.ZodBoolean;
|
|
1475
|
+
}, "strict", z.ZodTypeAny, {
|
|
1476
|
+
status: "active" | "revoked" | "expired" | "unavailable" | "not_found";
|
|
1477
|
+
active: boolean;
|
|
1478
|
+
revoked: boolean;
|
|
1479
|
+
cid: string;
|
|
1480
|
+
expired: boolean;
|
|
1481
|
+
exists: boolean;
|
|
1482
|
+
}, {
|
|
1483
|
+
status: "active" | "revoked" | "expired" | "unavailable" | "not_found";
|
|
1484
|
+
active: boolean;
|
|
1485
|
+
revoked: boolean;
|
|
1486
|
+
cid: string;
|
|
1487
|
+
expired: boolean;
|
|
1488
|
+
exists: boolean;
|
|
1489
|
+
}>, {
|
|
1490
|
+
status: "active" | "revoked" | "expired" | "unavailable" | "not_found";
|
|
1491
|
+
active: boolean;
|
|
1492
|
+
revoked: boolean;
|
|
1493
|
+
cid: string;
|
|
1494
|
+
expired: boolean;
|
|
1495
|
+
exists: boolean;
|
|
1496
|
+
}, {
|
|
1497
|
+
status: "active" | "revoked" | "expired" | "unavailable" | "not_found";
|
|
1498
|
+
active: boolean;
|
|
1499
|
+
revoked: boolean;
|
|
1500
|
+
cid: string;
|
|
1501
|
+
expired: boolean;
|
|
1502
|
+
exists: boolean;
|
|
1503
|
+
}>;
|
|
1504
|
+
type DelegationStatus = z.infer<typeof DelegationStatusSchema>;
|
|
1462
1505
|
/**
|
|
1463
1506
|
* Entry in the capability registry mapping a capability to available keys.
|
|
1464
1507
|
*/
|
|
@@ -1725,8 +1768,8 @@ declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
1725
1768
|
}, "strip", z.ZodTypeAny, {
|
|
1726
1769
|
path: string;
|
|
1727
1770
|
actions: string[];
|
|
1728
|
-
spaceId: string;
|
|
1729
1771
|
createdAt: Date;
|
|
1772
|
+
spaceId: string;
|
|
1730
1773
|
cid: string;
|
|
1731
1774
|
isRevoked: boolean;
|
|
1732
1775
|
delegator: string;
|
|
@@ -1738,8 +1781,8 @@ declare const DelegationRecordSchema: z.ZodObject<{
|
|
|
1738
1781
|
}, {
|
|
1739
1782
|
path: string;
|
|
1740
1783
|
actions: string[];
|
|
1741
|
-
spaceId: string;
|
|
1742
1784
|
createdAt: Date;
|
|
1785
|
+
spaceId: string;
|
|
1743
1786
|
cid: string;
|
|
1744
1787
|
isRevoked: boolean;
|
|
1745
1788
|
delegator: string;
|
|
@@ -2248,8 +2291,6 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2248
2291
|
/** Human-readable description of what is being shared */
|
|
2249
2292
|
description: z.ZodOptional<z.ZodString>;
|
|
2250
2293
|
}, "strip", z.ZodTypeAny, {
|
|
2251
|
-
schema: "base64" | "compact" | "ipfs";
|
|
2252
|
-
url: string;
|
|
2253
2294
|
delegation: {
|
|
2254
2295
|
path: string;
|
|
2255
2296
|
expiry: Date;
|
|
@@ -2264,12 +2305,12 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2264
2305
|
allowSubDelegation?: boolean | undefined;
|
|
2265
2306
|
authHeader?: string | undefined;
|
|
2266
2307
|
};
|
|
2308
|
+
schema: "base64" | "compact" | "ipfs";
|
|
2309
|
+
url: string;
|
|
2267
2310
|
token: string;
|
|
2268
2311
|
description?: string | undefined;
|
|
2269
2312
|
expiresAt?: Date | undefined;
|
|
2270
2313
|
}, {
|
|
2271
|
-
schema: "base64" | "compact" | "ipfs";
|
|
2272
|
-
url: string;
|
|
2273
2314
|
delegation: {
|
|
2274
2315
|
path: string;
|
|
2275
2316
|
expiry: Date;
|
|
@@ -2284,6 +2325,8 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2284
2325
|
allowSubDelegation?: boolean | undefined;
|
|
2285
2326
|
authHeader?: string | undefined;
|
|
2286
2327
|
};
|
|
2328
|
+
schema: "base64" | "compact" | "ipfs";
|
|
2329
|
+
url: string;
|
|
2287
2330
|
token: string;
|
|
2288
2331
|
description?: string | undefined;
|
|
2289
2332
|
expiresAt?: Date | undefined;
|
|
@@ -2366,15 +2409,19 @@ declare const DelegationManagerConfigSchema: z.ZodObject<{
|
|
|
2366
2409
|
session: z.ZodEffects<z.ZodUnknown, ServiceSession, unknown>;
|
|
2367
2410
|
/** Platform-specific invoke function */
|
|
2368
2411
|
invoke: z.ZodEffects<z.ZodUnknown, InvokeFunction, unknown>;
|
|
2412
|
+
/** Platform-specific invoke function for raw resource URIs */
|
|
2413
|
+
invokeAny: z.ZodOptional<z.ZodEffects<z.ZodUnknown, InvokeAnyFunction, unknown>>;
|
|
2369
2414
|
/** Optional custom fetch implementation */
|
|
2370
2415
|
fetch: z.ZodOptional<z.ZodEffects<z.ZodUnknown, FetchFunction, unknown>>;
|
|
2371
2416
|
}, "strip", z.ZodTypeAny, {
|
|
2372
2417
|
session: ServiceSession;
|
|
2373
2418
|
hosts: string[];
|
|
2374
2419
|
invoke: InvokeFunction;
|
|
2420
|
+
invokeAny?: InvokeAnyFunction | undefined;
|
|
2375
2421
|
fetch?: FetchFunction | undefined;
|
|
2376
2422
|
}, {
|
|
2377
2423
|
hosts: string[];
|
|
2424
|
+
invokeAny?: unknown;
|
|
2378
2425
|
session?: unknown;
|
|
2379
2426
|
invoke?: unknown;
|
|
2380
2427
|
fetch?: unknown;
|
|
@@ -2562,8 +2609,8 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
|
|
|
2562
2609
|
space: string;
|
|
2563
2610
|
service: string;
|
|
2564
2611
|
}[];
|
|
2565
|
-
expiry: Date;
|
|
2566
2612
|
delegation: string;
|
|
2613
|
+
expiry: Date;
|
|
2567
2614
|
cid: string;
|
|
2568
2615
|
delegateDID: string;
|
|
2569
2616
|
}, {
|
|
@@ -2573,8 +2620,8 @@ declare const CreateDelegationWasmResultSchema: z.ZodObject<{
|
|
|
2573
2620
|
space: string;
|
|
2574
2621
|
service: string;
|
|
2575
2622
|
}[];
|
|
2576
|
-
expiry: Date;
|
|
2577
2623
|
delegation: string;
|
|
2624
|
+
expiry: Date;
|
|
2578
2625
|
cid: string;
|
|
2579
2626
|
delegateDID: string;
|
|
2580
2627
|
}>;
|
|
@@ -3630,6 +3677,7 @@ declare class DelegationManager {
|
|
|
3630
3677
|
private hosts;
|
|
3631
3678
|
private session;
|
|
3632
3679
|
private invoke;
|
|
3680
|
+
private invokeAny?;
|
|
3633
3681
|
private fetchFn;
|
|
3634
3682
|
/**
|
|
3635
3683
|
* Creates a new DelegationManager instance.
|
|
@@ -3690,6 +3738,11 @@ declare class DelegationManager {
|
|
|
3690
3738
|
* ```
|
|
3691
3739
|
*/
|
|
3692
3740
|
revoke(cid: string): Promise<Result<void>>;
|
|
3741
|
+
/**
|
|
3742
|
+
* Reads the node-confirmed lifecycle state of one delegation without
|
|
3743
|
+
* exposing delegation metadata.
|
|
3744
|
+
*/
|
|
3745
|
+
status(cid: string): Promise<Result<DelegationStatus>>;
|
|
3693
3746
|
/**
|
|
3694
3747
|
* Lists all delegations for the current session's space.
|
|
3695
3748
|
*
|
|
@@ -3821,6 +3874,55 @@ interface ShareAccess {
|
|
|
3821
3874
|
/** The path prefix for this share */
|
|
3822
3875
|
path: string;
|
|
3823
3876
|
}
|
|
3877
|
+
/**
|
|
3878
|
+
* Parameters for attenuating a received share to another principal.
|
|
3879
|
+
*
|
|
3880
|
+
* Omitted path/actions/expiry inherit the received share's exact values. Any
|
|
3881
|
+
* supplied value must be equal to or an attenuated subset of the parent.
|
|
3882
|
+
*/
|
|
3883
|
+
interface DelegateReceivedShareParams {
|
|
3884
|
+
/** DID that may exercise the child delegation. */
|
|
3885
|
+
delegateDID: string;
|
|
3886
|
+
/** Equal to or below the shared path. Defaults to the shared path. */
|
|
3887
|
+
path?: string;
|
|
3888
|
+
/** Subset of the shared actions. Defaults to all shared actions. */
|
|
3889
|
+
actions?: string[];
|
|
3890
|
+
/** No later than the sharing-link expiry. Defaults to the parent expiry. */
|
|
3891
|
+
expiry?: Date;
|
|
3892
|
+
/** Optional node origin that further narrows the configured-host allowlist. */
|
|
3893
|
+
expectedHost?: string;
|
|
3894
|
+
}
|
|
3895
|
+
/**
|
|
3896
|
+
* A transport-ready child delegation with non-secret source lineage.
|
|
3897
|
+
*
|
|
3898
|
+
* `delegation.delegationHeader` is a live bearer credential. Treat it like a
|
|
3899
|
+
* secret: do not log it or persist it outside secure credential storage.
|
|
3900
|
+
* Only `source` is safe to retain as non-secret lineage metadata.
|
|
3901
|
+
*/
|
|
3902
|
+
interface DelegatedShareAccess {
|
|
3903
|
+
delegation: Delegation & {
|
|
3904
|
+
delegationHeader: {
|
|
3905
|
+
Authorization: string;
|
|
3906
|
+
};
|
|
3907
|
+
ownerAddress: string;
|
|
3908
|
+
chainId: number;
|
|
3909
|
+
host: string;
|
|
3910
|
+
resources: Array<{
|
|
3911
|
+
service: string;
|
|
3912
|
+
space: string;
|
|
3913
|
+
path: string;
|
|
3914
|
+
actions: string[];
|
|
3915
|
+
}>;
|
|
3916
|
+
disableSubDelegation: boolean;
|
|
3917
|
+
};
|
|
3918
|
+
source: {
|
|
3919
|
+
parentCid: string;
|
|
3920
|
+
spaceId: string;
|
|
3921
|
+
path: string;
|
|
3922
|
+
host: string;
|
|
3923
|
+
expiresAt: Date;
|
|
3924
|
+
};
|
|
3925
|
+
}
|
|
3824
3926
|
/**
|
|
3825
3927
|
* Configuration for SharingService.
|
|
3826
3928
|
*/
|
|
@@ -3867,6 +3969,8 @@ interface SharingServiceConfig {
|
|
|
3867
3969
|
* Creates UCAN delegations directly without requiring server roundtrip.
|
|
3868
3970
|
*/
|
|
3869
3971
|
createDelegationWasm?: (params: CreateDelegationWasmParams) => CreateDelegationWasmResult;
|
|
3972
|
+
/** Compute a CID for serialized delegation bytes. Required for share attenuation. */
|
|
3973
|
+
computeCid?: (data: Uint8Array, codec: bigint) => string;
|
|
3870
3974
|
/**
|
|
3871
3975
|
* Path prefix for KV operations.
|
|
3872
3976
|
* When set, paths passed to generate() are prefixed with this value.
|
|
@@ -3928,6 +4032,12 @@ interface ISharingService {
|
|
|
3928
4032
|
* creates a sub-delegation to the current session key.
|
|
3929
4033
|
*/
|
|
3930
4034
|
receive(link: string, options?: ReceiveOptions): Promise<Result<ShareAccess, DelegationError>>;
|
|
4035
|
+
/**
|
|
4036
|
+
* Consume a sharing link locally and create an attenuated child delegation.
|
|
4037
|
+
* The raw link and embedded private JWK are never returned. The returned
|
|
4038
|
+
* child delegation is itself a sensitive bearer credential.
|
|
4039
|
+
*/
|
|
4040
|
+
delegateReceivedShare(link: string, params: DelegateReceivedShareParams): Promise<Result<DelegatedShareAccess, DelegationError>>;
|
|
3931
4041
|
/**
|
|
3932
4042
|
* Encode sharing data into a link string.
|
|
3933
4043
|
*/
|
|
@@ -3986,6 +4096,7 @@ declare class SharingService implements ISharingService {
|
|
|
3986
4096
|
private baseUrl;
|
|
3987
4097
|
private createDelegationFn?;
|
|
3988
4098
|
private createDelegationWasmFn?;
|
|
4099
|
+
private computeCidFn?;
|
|
3989
4100
|
private pathPrefix;
|
|
3990
4101
|
private sessionExpiry?;
|
|
3991
4102
|
private onRootDelegationNeeded?;
|
|
@@ -4059,6 +4170,16 @@ declare class SharingService implements ISharingService {
|
|
|
4059
4170
|
* 4. Return ShareAccess with pre-configured KV service
|
|
4060
4171
|
*/
|
|
4061
4172
|
receive(link: string, options?: ReceiveOptions): Promise<Result<ShareAccess, DelegationError>>;
|
|
4173
|
+
/**
|
|
4174
|
+
* Create a constrained child delegation from a received sharing link.
|
|
4175
|
+
*
|
|
4176
|
+
* This is the safe handoff for a browser delegating shared input to an
|
|
4177
|
+
* agent or service: the bearer link is decoded and used only in this SDK
|
|
4178
|
+
* instance, while the recipient receives a child UCAN without the embedded
|
|
4179
|
+
* private key. The child UCAN is a sensitive bearer credential and must not
|
|
4180
|
+
* be logged or stored insecurely.
|
|
4181
|
+
*/
|
|
4182
|
+
delegateReceivedShare(link: string, params: DelegateReceivedShareParams): Promise<Result<DelegatedShareAccess, DelegationError>>;
|
|
4062
4183
|
/**
|
|
4063
4184
|
* Encode sharing data into a link string.
|
|
4064
4185
|
*
|
|
@@ -4748,6 +4869,8 @@ interface SpaceHostResult {
|
|
|
4748
4869
|
activated?: string[];
|
|
4749
4870
|
/** Space IDs that were skipped (e.g., space doesn't exist yet) */
|
|
4750
4871
|
skipped?: string[];
|
|
4872
|
+
/** Raw node receipt CID. This identifies the commit event, not the delegation. */
|
|
4873
|
+
commitEventCid?: string;
|
|
4751
4874
|
}
|
|
4752
4875
|
/**
|
|
4753
4876
|
* Fetch the peer ID from TinyCloud server for space hosting.
|
|
@@ -4947,4 +5070,4 @@ declare const EXPIRY: {
|
|
|
4947
5070
|
declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
|
|
4948
5071
|
type ExpiryTier = keyof typeof EXPIRY;
|
|
4949
5072
|
|
|
4950
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
|
|
5073
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegateReceivedShareParams, type DelegatedResource, type DelegatedShareAccess, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DelegationStatus, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
|