@tinycloud/sdk-core 3.3.0-beta.17 → 3.3.0-beta.20
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/index.cjs +731 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +336 -1
- package/dist/index.d.ts +336 -1
- package/dist/index.js +731 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3591,6 +3591,341 @@ declare function verifyOwnerNodeBinding(options: VerifyOwnerNodeBindingOptions):
|
|
|
3591
3591
|
declare function httpUrlToMultiaddr(input: string): string;
|
|
3592
3592
|
declare function verifyDidKeyEd25519Signature(did: string, payload: Uint8Array, signature: Uint8Array): boolean;
|
|
3593
3593
|
|
|
3594
|
+
/**
|
|
3595
|
+
* Three-state registry verdict for an owner DID (TC-1443, TC-1444).
|
|
3596
|
+
*
|
|
3597
|
+
* A registry lookup has exactly three outcomes, and callers must never
|
|
3598
|
+
* collapse them:
|
|
3599
|
+
*
|
|
3600
|
+
* - `registered`: a verified owner record exists. `hosts: []` is a valid
|
|
3601
|
+
* registered record with no usable hosts (for example a tombstone), not
|
|
3602
|
+
* "no record".
|
|
3603
|
+
* - `unregistered`: the registry said there is no record and nothing
|
|
3604
|
+
* remembered says otherwise. Only this state may route an owner to a
|
|
3605
|
+
* new-user default.
|
|
3606
|
+
* - `unavailable`: anything else. Network errors, timeouts, non-200/404
|
|
3607
|
+
* statuses, unrecognised or oversize bodies, subject mismatches, bad
|
|
3608
|
+
* signatures, and records older than the remembered sequence all fail
|
|
3609
|
+
* closed here.
|
|
3610
|
+
*
|
|
3611
|
+
* {@link classifyRegistryLookup} is a pure classifier over one registry
|
|
3612
|
+
* response. It performs no I/O; `resolveOwnerHosts` (`registry-policy.ts`)
|
|
3613
|
+
* does the lookup for the opt-in `fail-closed` registry policy. The
|
|
3614
|
+
* classifier's rules are written to be portable: the shared vectors in
|
|
3615
|
+
* `test-vectors/registry-verdict/` state them for other implementations.
|
|
3616
|
+
*/
|
|
3617
|
+
type RegistryVerdictStatus = "registered" | "unregistered" | "unavailable";
|
|
3618
|
+
/** Which registry source produced a verdict. */
|
|
3619
|
+
type RegistryVerdictSource = "chain" | "chain-cache" | "offchain";
|
|
3620
|
+
/** Which source listed a host. `hint` is an address hint not yet confirmed by a node record. */
|
|
3621
|
+
type RegistryHostSource = RegistryVerdictSource | "hint";
|
|
3622
|
+
interface RegistryHost {
|
|
3623
|
+
/** Node DID that must answer `/info` at these origins, when the record names one. */
|
|
3624
|
+
readonly nodeDid?: string;
|
|
3625
|
+
/**
|
|
3626
|
+
* HTTP(S) origins (`scheme://host[:port]`, no path, query, fragment or
|
|
3627
|
+
* userinfo). Not filtered for HTTPS, address class or node identity: host
|
|
3628
|
+
* selection applies that policy.
|
|
3629
|
+
*/
|
|
3630
|
+
readonly urls: readonly string[];
|
|
3631
|
+
readonly source: RegistryHostSource;
|
|
3632
|
+
/** Expiry of the node record the origins came from, when it has one. */
|
|
3633
|
+
readonly expiresAt?: string;
|
|
3634
|
+
}
|
|
3635
|
+
type RegistryUnavailableReason =
|
|
3636
|
+
/** The registry could not be reached (refused, DNS, TLS, redirect refused). */
|
|
3637
|
+
"network-error"
|
|
3638
|
+
/** The lookup exceeded its time budget. */
|
|
3639
|
+
| "timeout"
|
|
3640
|
+
/** The registry answered with a status other than 200 or 404. */
|
|
3641
|
+
| "http-status"
|
|
3642
|
+
/** The body is not the registry's record or not-found response. */
|
|
3643
|
+
| "malformed-response"
|
|
3644
|
+
/** The body exceeds {@link REGISTRY_LOOKUP_MAX_BODY_BYTES}. */
|
|
3645
|
+
| "oversize-response"
|
|
3646
|
+
/** A record was returned for a different subject. */
|
|
3647
|
+
| "subject-mismatch"
|
|
3648
|
+
/** The record signature does not verify for its subject. */
|
|
3649
|
+
| "invalid-signature"
|
|
3650
|
+
/** The record's sequence is below the remembered sequence. */
|
|
3651
|
+
| "rollback"
|
|
3652
|
+
/** The registry said "not found" for a subject remembered as registered. */
|
|
3653
|
+
| "not-found-after-registered";
|
|
3654
|
+
interface RegisteredRegistryVerdict {
|
|
3655
|
+
readonly status: "registered";
|
|
3656
|
+
readonly subject: string;
|
|
3657
|
+
readonly source: RegistryVerdictSource;
|
|
3658
|
+
/** Sequence of the accepted record. Callers persist the maximum they have seen. */
|
|
3659
|
+
readonly sequence: number;
|
|
3660
|
+
/** Listed hosts in record order. Empty when the record lists no usable host. */
|
|
3661
|
+
readonly hosts: readonly RegistryHost[];
|
|
3662
|
+
}
|
|
3663
|
+
interface UnregisteredRegistryVerdict {
|
|
3664
|
+
readonly status: "unregistered";
|
|
3665
|
+
readonly subject: string;
|
|
3666
|
+
readonly source: RegistryVerdictSource;
|
|
3667
|
+
readonly hosts: readonly [];
|
|
3668
|
+
}
|
|
3669
|
+
interface UnavailableRegistryVerdict {
|
|
3670
|
+
readonly status: "unavailable";
|
|
3671
|
+
readonly subject: string;
|
|
3672
|
+
readonly source: RegistryVerdictSource;
|
|
3673
|
+
readonly reason: RegistryUnavailableReason;
|
|
3674
|
+
/** Human-readable detail for logs and errors. Not part of the contract. */
|
|
3675
|
+
readonly message: string;
|
|
3676
|
+
readonly hosts: readonly [];
|
|
3677
|
+
}
|
|
3678
|
+
type RegistryVerdict = RegisteredRegistryVerdict | UnregisteredRegistryVerdict | UnavailableRegistryVerdict;
|
|
3679
|
+
/**
|
|
3680
|
+
* One observed registry lookup: an HTTP response, or the reason none arrived.
|
|
3681
|
+
* The I/O layer must cap the raw body while reading it (as
|
|
3682
|
+
* `fetchLocationRecord` does); `body` is that capped body decoded as UTF-8.
|
|
3683
|
+
*/
|
|
3684
|
+
type RegistryLookupResponse = {
|
|
3685
|
+
readonly kind: "http";
|
|
3686
|
+
readonly status: number;
|
|
3687
|
+
readonly body: string;
|
|
3688
|
+
} | {
|
|
3689
|
+
readonly kind: "network-error";
|
|
3690
|
+
} | {
|
|
3691
|
+
readonly kind: "timeout";
|
|
3692
|
+
};
|
|
3693
|
+
interface ClassifyRegistryLookupOptions {
|
|
3694
|
+
/**
|
|
3695
|
+
* Highest record sequence previously accepted for this subject. Its
|
|
3696
|
+
* presence means the subject is known to be registered: a later not-found
|
|
3697
|
+
* or an older record is `unavailable`, never `unregistered`.
|
|
3698
|
+
*/
|
|
3699
|
+
rememberedSequence?: number | null;
|
|
3700
|
+
}
|
|
3701
|
+
type RegistryLookupInputErrorCode = "invalid-subject" | "invalid-remembered-sequence";
|
|
3702
|
+
/** The caller passed a lookup input that cannot be classified. */
|
|
3703
|
+
declare class RegistryLookupInputError extends TypeError {
|
|
3704
|
+
readonly code: RegistryLookupInputErrorCode;
|
|
3705
|
+
constructor(code: RegistryLookupInputErrorCode, message: string);
|
|
3706
|
+
}
|
|
3707
|
+
/** Largest registry response body accepted, in UTF-8 bytes. */
|
|
3708
|
+
declare const REGISTRY_LOOKUP_MAX_BODY_BYTES: number;
|
|
3709
|
+
/** The exact body of the location registry's 404 for a subject with no record. */
|
|
3710
|
+
declare const REGISTRY_NOT_FOUND_BODY = "{\"error\":\"location record not found\"}";
|
|
3711
|
+
/**
|
|
3712
|
+
* Classify one off-chain location registry v1 response for `subject`.
|
|
3713
|
+
*
|
|
3714
|
+
* Checks run in this order, and the first failure decides the reason:
|
|
3715
|
+
* transport (`network-error`, `timeout`); status other than 200 or 404
|
|
3716
|
+
* (`http-status`); body over 65536 UTF-8 bytes (`oversize-response`). A 404
|
|
3717
|
+
* is `unregistered` only if its body, with leading and trailing JSON
|
|
3718
|
+
* whitespace removed, is exactly {@link REGISTRY_NOT_FOUND_BODY} and no
|
|
3719
|
+
* sequence is remembered. A 200 must be strict JSON holding a valid v1
|
|
3720
|
+
* `record` (`malformed-response`) for exactly `subject`
|
|
3721
|
+
* (`subject-mismatch`) whose signature verifies (`invalid-signature`) and
|
|
3722
|
+
* whose sequence is not below the remembered one (`rollback`).
|
|
3723
|
+
*
|
|
3724
|
+
* A 404 is unauthenticated: its exact bytes are the only evidence that the
|
|
3725
|
+
* registry itself answered.
|
|
3726
|
+
*
|
|
3727
|
+
* @throws RegistryLookupInputError if `subject` is not a canonical
|
|
3728
|
+
* `did:pkh:eip155:<chainId>:<EIP-55 address>` or Ed25519 `did:key`, or
|
|
3729
|
+
* `rememberedSequence` is not a non-negative safe integer.
|
|
3730
|
+
*/
|
|
3731
|
+
declare function classifyRegistryLookup(subject: string, response: RegistryLookupResponse, options?: ClassifyRegistryLookupOptions): Promise<RegistryVerdict>;
|
|
3732
|
+
|
|
3733
|
+
/**
|
|
3734
|
+
* Registry policy for host resolution and space creation (TC-1443).
|
|
3735
|
+
*
|
|
3736
|
+
* - `legacy-fallback` (the default, deprecated): {@link resolveTinyCloudHosts}
|
|
3737
|
+
* as before. A registry miss or failure silently routes to the hosted
|
|
3738
|
+
* fallback node, with a one-time deprecation warning.
|
|
3739
|
+
* - `fail-closed` (opt-in): routing and space creation act on the three-state
|
|
3740
|
+
* registry verdict. `unavailable` is never treated as `unregistered`.
|
|
3741
|
+
*
|
|
3742
|
+
* Registry lookups key on the owner's signer address, never the session
|
|
3743
|
+
* chain. The v1 registry stores records under an exact
|
|
3744
|
+
* `did:pkh:eip155:<chain>:<EIP-55 address>` subject, so v1 lookups use
|
|
3745
|
+
* {@link registryOwnerSubjectV1} with a configured chain (default 1). Registry
|
|
3746
|
+
* v2 keys owner records on the EIP-55 address alone, chain-independent.
|
|
3747
|
+
*/
|
|
3748
|
+
|
|
3749
|
+
type RegistryPolicy = "legacy-fallback" | "fail-closed";
|
|
3750
|
+
/** Chain of the v1 registry subject when none is configured. */
|
|
3751
|
+
declare const DEFAULT_REGISTRY_OWNER_CHAIN_ID = 1;
|
|
3752
|
+
/** Host for `unregistered` owners under `fail-closed` when none is configured. */
|
|
3753
|
+
declare const DEFAULT_NEW_USER_HOST = "https://node.tinycloud.xyz";
|
|
3754
|
+
/** Budget for one registry lookup, covering the request and the body. */
|
|
3755
|
+
declare const DEFAULT_REGISTRY_LOOKUP_TIMEOUT_MS = 3000;
|
|
3756
|
+
/** Default key {@link createLocalStorageRegistrySequenceStore} stores its sequences under. */
|
|
3757
|
+
declare const DEFAULT_REGISTRY_SEQUENCE_STORAGE_KEY = "tinycloud.registrySequences.v1";
|
|
3758
|
+
/**
|
|
3759
|
+
* The v1 registry subject for an owner: `did:pkh:eip155:<registryChainId>:<EIP-55 address>`.
|
|
3760
|
+
*
|
|
3761
|
+
* Built from the signer address and a configured chain, never from the
|
|
3762
|
+
* session chain, so switching wallet chains never changes the lookup. Registry
|
|
3763
|
+
* v2 will key on the EIP-55 address alone.
|
|
3764
|
+
*/
|
|
3765
|
+
declare function registryOwnerSubjectV1(address: string, registryChainId?: number): string;
|
|
3766
|
+
/**
|
|
3767
|
+
* The highest registry record sequence accepted per subject. A remembered
|
|
3768
|
+
* sequence marks the subject as registered: a later not-found or an older
|
|
3769
|
+
* record is `unavailable`, never `unregistered`.
|
|
3770
|
+
*
|
|
3771
|
+
* `set` is only called with a sequence above the remembered one. A `get`
|
|
3772
|
+
* failure fails that lookup closed (`RegistryUnavailableError`, never
|
|
3773
|
+
* "nothing remembered"). A `set` failure is logged once and the verdict in
|
|
3774
|
+
* hand stands: failing to remember weakens later rollback detection but
|
|
3775
|
+
* never turns a correct `registered` answer into a lockout.
|
|
3776
|
+
*/
|
|
3777
|
+
interface RegistrySequenceStore {
|
|
3778
|
+
get(subject: string): number | undefined | Promise<number | undefined>;
|
|
3779
|
+
set(subject: string, sequence: number): void | Promise<void>;
|
|
3780
|
+
}
|
|
3781
|
+
/** In-memory {@link RegistrySequenceStore}. Does not persist across process restarts. */
|
|
3782
|
+
declare function createInMemoryRegistrySequenceStore(): RegistrySequenceStore;
|
|
3783
|
+
/**
|
|
3784
|
+
* `localStorage`-backed {@link RegistrySequenceStore}, one JSON object under
|
|
3785
|
+
* `storageKey`. Falls back to an in-memory store when `localStorage` is
|
|
3786
|
+
* unavailable. Sequences are also kept in memory, so a failed write (full or
|
|
3787
|
+
* read-only storage) is still remembered for this page. A storage read that
|
|
3788
|
+
* throws, or a corrupt stored value, throws instead of being reset:
|
|
3789
|
+
* forgetting a sequence would let a registry not-found read as
|
|
3790
|
+
* `unregistered`. Remove `storageKey` to reset.
|
|
3791
|
+
*/
|
|
3792
|
+
declare function createLocalStorageRegistrySequenceStore(storage?: WebStorageLike, storageKey?: string): RegistrySequenceStore;
|
|
3793
|
+
interface ResolveOwnerHostsOptions {
|
|
3794
|
+
/** Location registry base URL. Default https://registry.tinycloud.xyz. */
|
|
3795
|
+
registryUrl?: string;
|
|
3796
|
+
/** Remembered sequences. Omit to remember nothing. */
|
|
3797
|
+
sequenceStore?: RegistrySequenceStore;
|
|
3798
|
+
/** Custom fetch implementation. Defaults to globalThis.fetch. */
|
|
3799
|
+
fetch?: typeof fetch;
|
|
3800
|
+
/** Lookup budget in milliseconds. Default {@link DEFAULT_REGISTRY_LOOKUP_TIMEOUT_MS}. */
|
|
3801
|
+
timeoutMs?: number;
|
|
3802
|
+
}
|
|
3803
|
+
/**
|
|
3804
|
+
* Look up `subject` in the off-chain v1 location registry and classify the
|
|
3805
|
+
* answer with {@link classifyRegistryLookup}, using and updating the
|
|
3806
|
+
* remembered sequence. Transport failures, timeouts and oversize or non-UTF-8
|
|
3807
|
+
* bodies are `unavailable` verdicts. Performs no host probing and never
|
|
3808
|
+
* applies a fallback.
|
|
3809
|
+
*
|
|
3810
|
+
* @throws RegistryLookupInputError if `subject` is not canonical or a
|
|
3811
|
+
* remembered sequence is invalid. The subject is length-checked before any
|
|
3812
|
+
* other parsing.
|
|
3813
|
+
*/
|
|
3814
|
+
declare function resolveOwnerHosts(subject: string, options?: ResolveOwnerHostsOptions): Promise<RegistryVerdict>;
|
|
3815
|
+
/** Sign-in found no usable host for a registered owner, or none for an unregistered owner when `newUserHost` is null. */
|
|
3816
|
+
declare class NodeNotFoundError extends Error {
|
|
3817
|
+
readonly subject: string;
|
|
3818
|
+
readonly verdict: RegisteredRegistryVerdict | UnregisteredRegistryVerdict;
|
|
3819
|
+
readonly code: "node_not_found";
|
|
3820
|
+
constructor(subject: string, verdict: RegisteredRegistryVerdict | UnregisteredRegistryVerdict);
|
|
3821
|
+
}
|
|
3822
|
+
/**
|
|
3823
|
+
* The registry could not give a verdict: unreachable, timed out, an invalid
|
|
3824
|
+
* or rolled-back answer, no registry configured, or a lookup that threw
|
|
3825
|
+
* (`cause`). Never treated as "unregistered".
|
|
3826
|
+
*/
|
|
3827
|
+
declare class RegistryUnavailableError extends Error {
|
|
3828
|
+
readonly subject: string;
|
|
3829
|
+
readonly verdict: UnavailableRegistryVerdict | undefined;
|
|
3830
|
+
readonly code: "registry_unavailable";
|
|
3831
|
+
readonly cause?: unknown;
|
|
3832
|
+
constructor(subject: string, verdict: UnavailableRegistryVerdict | undefined, detail?: {
|
|
3833
|
+
message?: string;
|
|
3834
|
+
cause?: unknown;
|
|
3835
|
+
});
|
|
3836
|
+
}
|
|
3837
|
+
/** Space creation was refused: the owner's registry record does not list this host. */
|
|
3838
|
+
declare class NodeRegistryEntryExistsError extends Error {
|
|
3839
|
+
readonly subject: string;
|
|
3840
|
+
readonly host: string;
|
|
3841
|
+
readonly verdict: RegisteredRegistryVerdict;
|
|
3842
|
+
readonly code: "node_registry_entry_exists";
|
|
3843
|
+
/** HTTPS or loopback origins the owner's record lists, in record order. */
|
|
3844
|
+
readonly registeredHosts: string[];
|
|
3845
|
+
constructor(subject: string, host: string, verdict: RegisteredRegistryVerdict);
|
|
3846
|
+
}
|
|
3847
|
+
interface LookupOwnerRegistryVerdictOptions {
|
|
3848
|
+
/** Location registry base URL. `null` means none, which is `RegistryUnavailableError`. */
|
|
3849
|
+
registryUrl?: string | null;
|
|
3850
|
+
sequenceStore?: RegistrySequenceStore;
|
|
3851
|
+
fetch?: typeof fetch;
|
|
3852
|
+
timeoutMs?: number;
|
|
3853
|
+
}
|
|
3854
|
+
/**
|
|
3855
|
+
* {@link resolveOwnerHosts} for policy decisions: a lookup that throws, or no
|
|
3856
|
+
* configured registry, becomes {@link RegistryUnavailableError}. An
|
|
3857
|
+
* `unavailable` verdict is returned as a verdict.
|
|
3858
|
+
*/
|
|
3859
|
+
declare function lookupOwnerRegistryVerdict(subject: string, options?: LookupOwnerRegistryVerdictOptions): Promise<RegistryVerdict>;
|
|
3860
|
+
interface NodeNotFoundContext {
|
|
3861
|
+
readonly error: NodeNotFoundError | RegistryUnavailableError;
|
|
3862
|
+
/** 1 for the first failure, incremented after each `retry`. */
|
|
3863
|
+
readonly attempt: number;
|
|
3864
|
+
}
|
|
3865
|
+
type NodeNotFoundDecision = {
|
|
3866
|
+
readonly action: "retry";
|
|
3867
|
+
} | {
|
|
3868
|
+
readonly action: "use-host";
|
|
3869
|
+
readonly host: string;
|
|
3870
|
+
} | {
|
|
3871
|
+
readonly action: "abort";
|
|
3872
|
+
};
|
|
3873
|
+
/**
|
|
3874
|
+
* Decides what sign-in does when no host can be resolved under `fail-closed`:
|
|
3875
|
+
* look up again, use another host, or abort with the error. A `use-host`
|
|
3876
|
+
* host must be an HTTPS or loopback HTTP origin. The SDK does not verify its
|
|
3877
|
+
* identity, and it persists with the session like any resolved host; space
|
|
3878
|
+
* creation there still goes through the creation guard.
|
|
3879
|
+
*/
|
|
3880
|
+
type OnNodeNotFound = (context: NodeNotFoundContext) => NodeNotFoundDecision | Promise<NodeNotFoundDecision>;
|
|
3881
|
+
interface FailClosedHostOptions extends LookupOwnerRegistryVerdictOptions {
|
|
3882
|
+
/** Chain of the v1 registry subject. Default {@link DEFAULT_REGISTRY_OWNER_CHAIN_ID}. */
|
|
3883
|
+
registryChainId?: number;
|
|
3884
|
+
/**
|
|
3885
|
+
* Host for owners the registry reports as `unregistered`, and only them.
|
|
3886
|
+
* Default {@link DEFAULT_NEW_USER_HOST}. `null`: unregistered owners get
|
|
3887
|
+
* {@link NodeNotFoundError}.
|
|
3888
|
+
*/
|
|
3889
|
+
newUserHost?: string | null;
|
|
3890
|
+
/** Without a callback, resolution throws the error. */
|
|
3891
|
+
onNodeNotFound?: OnNodeNotFound;
|
|
3892
|
+
/**
|
|
3893
|
+
* Probe local nodes before routing on the verdict. Default true. Only
|
|
3894
|
+
* configured candidates (`localNodeUrl`, `localLinkName`) and
|
|
3895
|
+
* `*.local.tinycloud.link` hosts from a `registered` verdict are probed.
|
|
3896
|
+
*/
|
|
3897
|
+
autoDiscoverLocalNode?: boolean;
|
|
3898
|
+
localNodeUrl?: string;
|
|
3899
|
+
localLinkName?: string;
|
|
3900
|
+
expectedNodeDid?: string;
|
|
3901
|
+
localNodeIdentityStore?: LocalNodeIdentityStore;
|
|
3902
|
+
}
|
|
3903
|
+
interface FailClosedHosts {
|
|
3904
|
+
hosts: string[];
|
|
3905
|
+
/** The registry verdict behind `hosts`. Absent when a verified local node was used. */
|
|
3906
|
+
verdict?: RegistryVerdict;
|
|
3907
|
+
}
|
|
3908
|
+
/**
|
|
3909
|
+
* Resolve the hosts for `address` under the `fail-closed` policy. The
|
|
3910
|
+
* registry verdict for {@link registryOwnerSubjectV1} comes first. Then a
|
|
3911
|
+
* verified local node is used if one is configured or listed by a
|
|
3912
|
+
* `registered` verdict. Otherwise `registered` routes to the record's hosts
|
|
3913
|
+
* (record order, HTTPS or loopback only), `unregistered` to `newUserHost`,
|
|
3914
|
+
* and `unavailable` or a record without a usable host goes to
|
|
3915
|
+
* `onNodeNotFound`, else throws.
|
|
3916
|
+
*/
|
|
3917
|
+
declare function resolveFailClosedTinyCloudHosts(address: string, options?: FailClosedHostOptions): Promise<FailClosedHosts>;
|
|
3918
|
+
/**
|
|
3919
|
+
* The space-creation guard under `fail-closed`: creating a space on `host` is
|
|
3920
|
+
* allowed for an `unregistered` owner, or for a `registered` owner whose
|
|
3921
|
+
* record lists `host` as an HTTPS or loopback HTTP origin.
|
|
3922
|
+
*
|
|
3923
|
+
* @throws NodeRegistryEntryExistsError for a registered owner whose record
|
|
3924
|
+
* does not list `host` that way (including an empty record).
|
|
3925
|
+
* @throws RegistryUnavailableError for an `unavailable` verdict.
|
|
3926
|
+
*/
|
|
3927
|
+
declare function assertSpaceCreationAllowed(verdict: RegistryVerdict, host: string): void;
|
|
3928
|
+
|
|
3594
3929
|
/**
|
|
3595
3930
|
* Default lifetimes for the various delegation shapes the SDK mints.
|
|
3596
3931
|
*
|
|
@@ -3620,4 +3955,4 @@ declare const EXPIRY: {
|
|
|
3620
3955
|
declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
|
|
3621
3956
|
type ExpiryTier = keyof typeof EXPIRY;
|
|
3622
3957
|
|
|
3623
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, 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, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CanonicalTinyCloudIdentity, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, EMAIL_CREDENTIAL_MAX_AGE_SECONDS, EMAIL_DOMAIN_CREDENTIAL_MAX_AGE_SECONDS, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, LocationRegistryHttpError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, OPENKEY_ACTION_ID_SEPARATOR, OWNER_NODE_BINDING_TIMEOUT_MS, type OpenKeyCallbackStrategy, type OpenKeyManageKeyCallbackStrategy, OpenKeyManageKeyError, type OpenKeyManageKeyErrorCode, type OpenKeyManageKeyFetch, type OpenKeyManageKeySigningRequestBody, type OpenKeyManageKeySigningResponseBody, type OpenKeyManageKeySigningStrategyOptions, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type PublishLocationRecordOptions, type RecapAttenuation, type RegisterBatchSuccess, 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, ShareLink, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, type SignedSiweCacao, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TERMINAL_DELEGATION_FACT, TINYCLOUD_CANONICAL_IDENTITY_CLAIM, TINYCLOUD_MANAGE_KEY_SCOPE, type TerminalDelegationSigningKey, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, type VerifiedOwnerNodeBinding, type VerifyOwnerNodeBindingOptions, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, composeManifestRequest, createEmailCredentialRequirement, createEmailDomainCredentialRequirement, createHolderBinding, createInMemoryLocalNodeIdentityStore, createLocalStorageLocalNodeIdentityStore, createOpenKeyCallbackSigningStrategy, createOpenKeyManageKeySigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, hasTinyCloudManageKeyScope, holderBindingCanonicalBytes, holderBindingSigningBytes, httpResponseError, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isExplicitOnlyAction, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, markDelegationTerminal, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseCanonicalTinyCloudIdentity, parseCanonicalTinyCloudIdentityClaims, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSignedSiweCacao, parseSpaceUri, pkhDid, principalDid, principalDidEquals, publishLocationRecord, recapCaveatsEqual, requestTinyCloudManageKeyScope, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyOwnerNodeBinding, verifyStorageReceipt };
|
|
3958
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountApplicationRegisterOptions, type AccountDelegation, type AccountDelegationListOptions, AccountDelegationPage, AccountDelegationQueryOptions, 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, CREDENTIAL_ERROR_CODES, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CanonicalTinyCloudIdentity, type CapabilityPresentationEnvelopeV1, CaveatedDelegationUnsupportedError, type ClassifyRegistryLookupOptions, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, CreateDelegationParams, CredentialError, type CredentialErrorCode, CredentialFlowDescriptor, CredentialHolderBinding, CredentialIssuerMetadata, CredentialRequirement, CredentialStorageReceipt, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_LOCAL_NODE_PIN_STORAGE_KEY, DEFAULT_LOCAL_NODE_URL, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_NEW_USER_HOST, DEFAULT_REGISTRY_LOOKUP_TIMEOUT_MS, DEFAULT_REGISTRY_OWNER_CHAIN_ID, DEFAULT_REGISTRY_SEQUENCE_STORAGE_KEY, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, Delegation, DelegationManager, DelegationRevocationReceipt, type DidCacheKeyOptions, type DidEqualsOptions, type DiscoverLocalTinyCloudNodeOptions, type DiscoveredLocalTinyCloudNode, EMAIL_CREDENTIAL_MAX_AGE_SECONDS, EMAIL_DOMAIN_CREDENTIAL_MAX_AGE_SECONDS, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type FailClosedHostOptions, type FailClosedHosts, GenerateShareParams, ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type ImmutableSiweFields, IssuedCredentialEnvelope, LOCAL_LINK_HOST_SUFFIX, LOCAL_LINK_PROBE_TIMEOUT_MS, LOCAL_LOOPBACK_PROBE_TIMEOUT_MS, type LocalNodeIdentityStore, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, LocationRegistryHttpError, type LocationResolutionAttempt, type LocationSource, type LookupOwnerRegistryVerdictOptions, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type NodeNotFoundContext, type NodeNotFoundDecision, NodeNotFoundError, NodeRegistryEntryExistsError, OPENKEY_ACTION_ID_SEPARATOR, OWNER_NODE_BINDING_TIMEOUT_MS, type OnNodeNotFound, type OpenKeyCallbackStrategy, type OpenKeyManageKeyCallbackStrategy, OpenKeyManageKeyError, type OpenKeyManageKeyErrorCode, type OpenKeyManageKeyFetch, type OpenKeyManageKeySigningRequestBody, type OpenKeyManageKeySigningResponseBody, type OpenKeyManageKeySigningStrategyOptions, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedSessionProof, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type PublishLocationRecordOptions, REGISTRY_LOOKUP_MAX_BODY_BYTES, REGISTRY_NOT_FOUND_BODY, type RecapAttenuation, type RegisterBatchSuccess, type RegisteredRegistryVerdict, type RegistryHost, type RegistryHostSource, RegistryLookupInputError, type RegistryLookupInputErrorCode, type RegistryLookupResponse, type RegistryPolicy, type RegistrySequenceStore, RegistryUnavailableError, type RegistryUnavailableReason, type RegistryVerdict, type RegistryVerdictSource, type RegistryVerdictStatus, type ResolveCloudLocationOptions, type ResolveOwnerHostsOptions, 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, ShareLink, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, type SignedSiweCacao, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, SpaceInfo, SpaceService, type SpaceServiceConfig, StoredCredentialRecord, type SubsetCheckResult, TERMINAL_DELEGATION_FACT, TINYCLOUD_CANONICAL_IDENTITY_CLAIM, TINYCLOUD_MANAGE_KEY_SCOPE, type TerminalDelegationSigningKey, TinyCloud, type TinyCloudAuthorizationRequestV1, type TinyCloudAuthorizationResultV1, type TinyCloudConfig, type TinyCloudEffectiveGrantV1, type TinyCloudSession, type UnavailableRegistryVerdict, type UnregisteredRegistryVerdict, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidatedPersistedSessionProof, type ValidationError, VerifiedCredential, type VerifiedOwnerNodeBinding, type VerifyOwnerNodeBindingOptions, VersionCheckError, type WasmRecapEntry, type WebStorageLike, actionContains, activateSessionWithHost, addressStorageKey, applyPrefix, assertSpaceCreationAllowed, buildSpaceUri, canonicalDigest, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, canonicalizeRecapCaveats, checkNodeInfo, classifyRegistryLookup, composeManifestRequest, createEmailCredentialRequirement, createEmailDomainCredentialRequirement, createHolderBinding, createInMemoryLocalNodeIdentityStore, createInMemoryRegistrySequenceStore, createLocalStorageLocalNodeIdentityStore, createLocalStorageRegistrySequenceStore, createOpenKeyCallbackSigningStrategy, createOpenKeyManageKeySigningStrategy, createSpaceService, createStorageReceipt, createStoredCredentialRecord, credentialEndpointPath, credentialError, credentialIndexKey, credentialMatchesRequirement, credentialRecordKey, credentialRequirementDigest, decodeBase64Url, defaultSignStrategy, defaultSpaceCreationHandler, descriptorSatisfiesRequirement, didCacheKey, didEquals, diffImmutableSiweFields, discoverLocalTinyCloudNode, encodeBase64Url, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, extractImmutableSiweFields, extractRecapAttenuations, fetchLocationRecord, fetchPeerId, hasTinyCloudManageKeyScope, holderBindingCanonicalBytes, holderBindingSigningBytes, httpResponseError, httpUrlToMultiaddr, isCapabilitySubset, isDigest, isEvmAddress, isExplicitOnlyAction, isPlausibleOpenKeyActionId, loadManifest, locationPayloadForRecord, lookupOwnerRegistryVerdict, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, markDelegationTerminal, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseCanonicalRecapResource, parseCanonicalTinyCloudIdentity, parseCanonicalTinyCloudIdentityClaims, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSignedSiweCacao, parseSpaceUri, pkhDid, principalDid, principalDidEquals, publishLocationRecord, recapCaveatsEqual, registryOwnerSubjectV1, requestTinyCloudManageKeyScope, resolveCloudLocation, resolveFailClosedTinyCloudHosts, resolveManifest, resolveManifestKnowledgeRoot, resolveOwnerHosts, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, sha256Base64Url, signLocationRecord, submitHostDelegation, unauthorizedRecapCapabilities, validateAuthorizationResultV1, validateClientSession, validateCredentialFlowDescriptor, validateCredentialHolderBinding, validateCredentialRequirement, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyEip191MessageSignature, verifyIssuedCredential, verifyLocationRecord, verifyOwnerNodeBinding, verifyStorageReceipt };
|