@tinycloud/sdk-core 2.2.0-beta.1 → 2.2.0-beta.4
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 +420 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -1
- package/dist/index.d.ts +100 -1
- package/dist/index.js +404 -1
- package/dist/index.js.map +1 -1
- package/package.json +7 -1
package/dist/index.d.cts
CHANGED
|
@@ -4437,4 +4437,103 @@ interface NodeInfo {
|
|
|
4437
4437
|
}
|
|
4438
4438
|
declare function checkNodeInfo(host: string, sdkProtocol: number, fetchFn?: typeof globalThis.fetch): Promise<NodeInfo>;
|
|
4439
4439
|
|
|
4440
|
-
|
|
4440
|
+
/**
|
|
4441
|
+
* TinyCloud location registry helpers.
|
|
4442
|
+
*
|
|
4443
|
+
* The registry maps a DID to one or more multiaddrs. Registry records are
|
|
4444
|
+
* signed by the DID subject; centralized storage is only a discovery cache.
|
|
4445
|
+
*/
|
|
4446
|
+
interface LocationRecordPayload {
|
|
4447
|
+
version: 1;
|
|
4448
|
+
subject: string;
|
|
4449
|
+
multiaddrs: string[];
|
|
4450
|
+
updated_at: string;
|
|
4451
|
+
sequence: number;
|
|
4452
|
+
}
|
|
4453
|
+
interface LocationRecord extends LocationRecordPayload {
|
|
4454
|
+
signature: string;
|
|
4455
|
+
}
|
|
4456
|
+
type LocationSource = "explicit" | "blockchain" | "centralized" | "fallback";
|
|
4457
|
+
declare const DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL = "https://registry.tinycloud.xyz";
|
|
4458
|
+
declare const DEFAULT_TINYCLOUD_FALLBACK_HOST = "https://node.tinycloud.xyz";
|
|
4459
|
+
interface LocationCandidate {
|
|
4460
|
+
source: LocationSource;
|
|
4461
|
+
multiaddrs: string[];
|
|
4462
|
+
record?: LocationRecord;
|
|
4463
|
+
}
|
|
4464
|
+
interface LocationResolutionAttempt {
|
|
4465
|
+
source: LocationSource;
|
|
4466
|
+
candidate?: LocationCandidate;
|
|
4467
|
+
error?: Error;
|
|
4468
|
+
}
|
|
4469
|
+
interface ResolvedCloudLocation {
|
|
4470
|
+
subject: string;
|
|
4471
|
+
source: LocationSource;
|
|
4472
|
+
multiaddrs: string[];
|
|
4473
|
+
record?: LocationRecord;
|
|
4474
|
+
attempts: LocationResolutionAttempt[];
|
|
4475
|
+
resolvedAt: string;
|
|
4476
|
+
}
|
|
4477
|
+
interface ResolveCloudLocationOptions {
|
|
4478
|
+
/** Highest-priority location supplied directly by the caller. */
|
|
4479
|
+
explicitMultiaddrs?: string[];
|
|
4480
|
+
/** Optional blockchain resolver adapter. */
|
|
4481
|
+
blockchain?: (subject: string) => Promise<LocationCandidateInput | null | undefined>;
|
|
4482
|
+
/** Centralized location registry base URL, e.g. https://registry.tinycloud.xyz. */
|
|
4483
|
+
centralizedRegistryUrl?: string;
|
|
4484
|
+
/** Lowest-priority fallback location. */
|
|
4485
|
+
fallbackMultiaddrs?: string[];
|
|
4486
|
+
/** Custom fetch implementation. Defaults to globalThis.fetch. */
|
|
4487
|
+
fetch?: typeof fetch;
|
|
4488
|
+
/** Verify centralized/blockchain record signatures. Default true. */
|
|
4489
|
+
verifyRecords?: boolean;
|
|
4490
|
+
}
|
|
4491
|
+
interface ResolvedTinyCloudHosts {
|
|
4492
|
+
hosts: string[];
|
|
4493
|
+
location: ResolvedCloudLocation;
|
|
4494
|
+
}
|
|
4495
|
+
interface ResolveTinyCloudHostsOptions {
|
|
4496
|
+
/** Highest-priority TinyCloud HTTP host URLs or multiaddrs supplied directly. */
|
|
4497
|
+
explicitHosts?: string[];
|
|
4498
|
+
/** Optional blockchain resolver adapter. */
|
|
4499
|
+
blockchain?: ResolveCloudLocationOptions["blockchain"];
|
|
4500
|
+
/** Centralized location registry URL. Default https://registry.tinycloud.xyz. */
|
|
4501
|
+
registryUrl?: string | null;
|
|
4502
|
+
/** Lowest-priority fallback HTTP host URLs or multiaddrs. Default hosted TinyCloud node. */
|
|
4503
|
+
fallbackHosts?: string[] | null;
|
|
4504
|
+
/** Custom fetch implementation. Defaults to globalThis.fetch. */
|
|
4505
|
+
fetch?: typeof fetch;
|
|
4506
|
+
/** Verify centralized/blockchain record signatures. Default true. */
|
|
4507
|
+
verifyRecords?: boolean;
|
|
4508
|
+
}
|
|
4509
|
+
type LocationCandidateInput = string[] | LocationRecord | {
|
|
4510
|
+
multiaddrs: string[];
|
|
4511
|
+
record?: LocationRecord;
|
|
4512
|
+
};
|
|
4513
|
+
type LocationRecordSigner = {
|
|
4514
|
+
type: "did:pkh";
|
|
4515
|
+
signMessage(message: string): Promise<string>;
|
|
4516
|
+
} | {
|
|
4517
|
+
type: "did:key";
|
|
4518
|
+
signBytes(bytes: Uint8Array): Promise<Uint8Array>;
|
|
4519
|
+
};
|
|
4520
|
+
declare class LocationRecordValidationError extends Error {
|
|
4521
|
+
constructor(message: string);
|
|
4522
|
+
}
|
|
4523
|
+
declare class CloudLocationResolutionError extends Error {
|
|
4524
|
+
readonly attempts: LocationResolutionAttempt[];
|
|
4525
|
+
constructor(subject: string, attempts: LocationResolutionAttempt[]);
|
|
4526
|
+
}
|
|
4527
|
+
declare function locationPayloadForRecord(record: LocationRecord): LocationRecordPayload;
|
|
4528
|
+
declare function canonicalLocationPayload(payload: LocationRecordPayload): string;
|
|
4529
|
+
declare function signLocationRecord(payload: LocationRecordPayload, signer: LocationRecordSigner): Promise<LocationRecord>;
|
|
4530
|
+
declare function validateLocationRecordPayload(input: unknown): LocationRecordPayload;
|
|
4531
|
+
declare function validateLocationRecord(input: unknown): LocationRecord;
|
|
4532
|
+
declare function verifyLocationRecord(input: LocationRecord): Promise<boolean>;
|
|
4533
|
+
declare function fetchLocationRecord(registryUrl: string, subject: string, fetchFn?: typeof fetch): Promise<LocationRecord | null>;
|
|
4534
|
+
declare function resolveCloudLocation(subject: string, options?: ResolveCloudLocationOptions): Promise<ResolvedCloudLocation>;
|
|
4535
|
+
declare function resolveTinyCloudHosts(subject: string, options?: ResolveTinyCloudHostsOptions): Promise<ResolvedTinyCloudHosts>;
|
|
4536
|
+
declare function multiaddrToHttpUrl(input: string): string;
|
|
4537
|
+
declare function httpUrlToMultiaddr(input: string): string;
|
|
4538
|
+
|
|
4539
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, 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_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, 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 EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, 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, 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 ManifestRegistryRecord, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, 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, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, applyPrefix, buildSpaceUri, canonicalLocationPayload, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, expandActionShortNames, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, loadManifest, locationPayloadForRecord, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseExpiry, parseRecapCapabilities, parseSpaceUri, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyLocationRecord };
|
package/dist/index.d.ts
CHANGED
|
@@ -4437,4 +4437,103 @@ interface NodeInfo {
|
|
|
4437
4437
|
}
|
|
4438
4438
|
declare function checkNodeInfo(host: string, sdkProtocol: number, fetchFn?: typeof globalThis.fetch): Promise<NodeInfo>;
|
|
4439
4439
|
|
|
4440
|
-
|
|
4440
|
+
/**
|
|
4441
|
+
* TinyCloud location registry helpers.
|
|
4442
|
+
*
|
|
4443
|
+
* The registry maps a DID to one or more multiaddrs. Registry records are
|
|
4444
|
+
* signed by the DID subject; centralized storage is only a discovery cache.
|
|
4445
|
+
*/
|
|
4446
|
+
interface LocationRecordPayload {
|
|
4447
|
+
version: 1;
|
|
4448
|
+
subject: string;
|
|
4449
|
+
multiaddrs: string[];
|
|
4450
|
+
updated_at: string;
|
|
4451
|
+
sequence: number;
|
|
4452
|
+
}
|
|
4453
|
+
interface LocationRecord extends LocationRecordPayload {
|
|
4454
|
+
signature: string;
|
|
4455
|
+
}
|
|
4456
|
+
type LocationSource = "explicit" | "blockchain" | "centralized" | "fallback";
|
|
4457
|
+
declare const DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL = "https://registry.tinycloud.xyz";
|
|
4458
|
+
declare const DEFAULT_TINYCLOUD_FALLBACK_HOST = "https://node.tinycloud.xyz";
|
|
4459
|
+
interface LocationCandidate {
|
|
4460
|
+
source: LocationSource;
|
|
4461
|
+
multiaddrs: string[];
|
|
4462
|
+
record?: LocationRecord;
|
|
4463
|
+
}
|
|
4464
|
+
interface LocationResolutionAttempt {
|
|
4465
|
+
source: LocationSource;
|
|
4466
|
+
candidate?: LocationCandidate;
|
|
4467
|
+
error?: Error;
|
|
4468
|
+
}
|
|
4469
|
+
interface ResolvedCloudLocation {
|
|
4470
|
+
subject: string;
|
|
4471
|
+
source: LocationSource;
|
|
4472
|
+
multiaddrs: string[];
|
|
4473
|
+
record?: LocationRecord;
|
|
4474
|
+
attempts: LocationResolutionAttempt[];
|
|
4475
|
+
resolvedAt: string;
|
|
4476
|
+
}
|
|
4477
|
+
interface ResolveCloudLocationOptions {
|
|
4478
|
+
/** Highest-priority location supplied directly by the caller. */
|
|
4479
|
+
explicitMultiaddrs?: string[];
|
|
4480
|
+
/** Optional blockchain resolver adapter. */
|
|
4481
|
+
blockchain?: (subject: string) => Promise<LocationCandidateInput | null | undefined>;
|
|
4482
|
+
/** Centralized location registry base URL, e.g. https://registry.tinycloud.xyz. */
|
|
4483
|
+
centralizedRegistryUrl?: string;
|
|
4484
|
+
/** Lowest-priority fallback location. */
|
|
4485
|
+
fallbackMultiaddrs?: string[];
|
|
4486
|
+
/** Custom fetch implementation. Defaults to globalThis.fetch. */
|
|
4487
|
+
fetch?: typeof fetch;
|
|
4488
|
+
/** Verify centralized/blockchain record signatures. Default true. */
|
|
4489
|
+
verifyRecords?: boolean;
|
|
4490
|
+
}
|
|
4491
|
+
interface ResolvedTinyCloudHosts {
|
|
4492
|
+
hosts: string[];
|
|
4493
|
+
location: ResolvedCloudLocation;
|
|
4494
|
+
}
|
|
4495
|
+
interface ResolveTinyCloudHostsOptions {
|
|
4496
|
+
/** Highest-priority TinyCloud HTTP host URLs or multiaddrs supplied directly. */
|
|
4497
|
+
explicitHosts?: string[];
|
|
4498
|
+
/** Optional blockchain resolver adapter. */
|
|
4499
|
+
blockchain?: ResolveCloudLocationOptions["blockchain"];
|
|
4500
|
+
/** Centralized location registry URL. Default https://registry.tinycloud.xyz. */
|
|
4501
|
+
registryUrl?: string | null;
|
|
4502
|
+
/** Lowest-priority fallback HTTP host URLs or multiaddrs. Default hosted TinyCloud node. */
|
|
4503
|
+
fallbackHosts?: string[] | null;
|
|
4504
|
+
/** Custom fetch implementation. Defaults to globalThis.fetch. */
|
|
4505
|
+
fetch?: typeof fetch;
|
|
4506
|
+
/** Verify centralized/blockchain record signatures. Default true. */
|
|
4507
|
+
verifyRecords?: boolean;
|
|
4508
|
+
}
|
|
4509
|
+
type LocationCandidateInput = string[] | LocationRecord | {
|
|
4510
|
+
multiaddrs: string[];
|
|
4511
|
+
record?: LocationRecord;
|
|
4512
|
+
};
|
|
4513
|
+
type LocationRecordSigner = {
|
|
4514
|
+
type: "did:pkh";
|
|
4515
|
+
signMessage(message: string): Promise<string>;
|
|
4516
|
+
} | {
|
|
4517
|
+
type: "did:key";
|
|
4518
|
+
signBytes(bytes: Uint8Array): Promise<Uint8Array>;
|
|
4519
|
+
};
|
|
4520
|
+
declare class LocationRecordValidationError extends Error {
|
|
4521
|
+
constructor(message: string);
|
|
4522
|
+
}
|
|
4523
|
+
declare class CloudLocationResolutionError extends Error {
|
|
4524
|
+
readonly attempts: LocationResolutionAttempt[];
|
|
4525
|
+
constructor(subject: string, attempts: LocationResolutionAttempt[]);
|
|
4526
|
+
}
|
|
4527
|
+
declare function locationPayloadForRecord(record: LocationRecord): LocationRecordPayload;
|
|
4528
|
+
declare function canonicalLocationPayload(payload: LocationRecordPayload): string;
|
|
4529
|
+
declare function signLocationRecord(payload: LocationRecordPayload, signer: LocationRecordSigner): Promise<LocationRecord>;
|
|
4530
|
+
declare function validateLocationRecordPayload(input: unknown): LocationRecordPayload;
|
|
4531
|
+
declare function validateLocationRecord(input: unknown): LocationRecord;
|
|
4532
|
+
declare function verifyLocationRecord(input: LocationRecord): Promise<boolean>;
|
|
4533
|
+
declare function fetchLocationRecord(registryUrl: string, subject: string, fetchFn?: typeof fetch): Promise<LocationRecord | null>;
|
|
4534
|
+
declare function resolveCloudLocation(subject: string, options?: ResolveCloudLocationOptions): Promise<ResolvedCloudLocation>;
|
|
4535
|
+
declare function resolveTinyCloudHosts(subject: string, options?: ResolveTinyCloudHostsOptions): Promise<ResolvedTinyCloudHosts>;
|
|
4536
|
+
declare function multiaddrToHttpUrl(input: string): string;
|
|
4537
|
+
declare function httpUrlToMultiaddr(input: string): string;
|
|
4538
|
+
|
|
4539
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, 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_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, 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 EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, 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, 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 ManifestRegistryRecord, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, 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, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, applyPrefix, buildSpaceUri, canonicalLocationPayload, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, expandActionShortNames, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, loadManifest, locationPayloadForRecord, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseExpiry, parseRecapCapabilities, parseSpaceUri, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyLocationRecord };
|
package/dist/index.js
CHANGED
|
@@ -4250,6 +4250,394 @@ async function checkNodeInfo(host, sdkProtocol, fetchFn = globalThis.fetch.bind(
|
|
|
4250
4250
|
};
|
|
4251
4251
|
}
|
|
4252
4252
|
|
|
4253
|
+
// src/location.ts
|
|
4254
|
+
import { multiaddr } from "@multiformats/multiaddr";
|
|
4255
|
+
import { multiaddrToUri } from "@multiformats/multiaddr-to-uri";
|
|
4256
|
+
import { uriToMultiaddr } from "@multiformats/uri-to-multiaddr";
|
|
4257
|
+
import { ed25519 } from "@noble/curves/ed25519";
|
|
4258
|
+
import { bases } from "multiformats/basics";
|
|
4259
|
+
import { verifyMessage } from "viem";
|
|
4260
|
+
var DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL = "https://registry.tinycloud.xyz";
|
|
4261
|
+
var DEFAULT_TINYCLOUD_FALLBACK_HOST = "https://node.tinycloud.xyz";
|
|
4262
|
+
var LocationRecordValidationError = class extends Error {
|
|
4263
|
+
constructor(message) {
|
|
4264
|
+
super(`Location record validation failed: ${message}`);
|
|
4265
|
+
this.name = "LocationRecordValidationError";
|
|
4266
|
+
}
|
|
4267
|
+
};
|
|
4268
|
+
var CloudLocationResolutionError = class extends Error {
|
|
4269
|
+
constructor(subject, attempts) {
|
|
4270
|
+
super(`Unable to resolve TinyCloud location for ${subject}`);
|
|
4271
|
+
this.name = "CloudLocationResolutionError";
|
|
4272
|
+
this.attempts = attempts;
|
|
4273
|
+
}
|
|
4274
|
+
};
|
|
4275
|
+
function locationPayloadForRecord(record) {
|
|
4276
|
+
return {
|
|
4277
|
+
version: record.version,
|
|
4278
|
+
subject: record.subject,
|
|
4279
|
+
multiaddrs: [...record.multiaddrs],
|
|
4280
|
+
updated_at: record.updated_at,
|
|
4281
|
+
sequence: record.sequence
|
|
4282
|
+
};
|
|
4283
|
+
}
|
|
4284
|
+
function canonicalLocationPayload(payload) {
|
|
4285
|
+
return JSON.stringify({
|
|
4286
|
+
version: payload.version,
|
|
4287
|
+
subject: payload.subject,
|
|
4288
|
+
multiaddrs: payload.multiaddrs,
|
|
4289
|
+
updated_at: payload.updated_at,
|
|
4290
|
+
sequence: payload.sequence
|
|
4291
|
+
});
|
|
4292
|
+
}
|
|
4293
|
+
async function signLocationRecord(payload, signer) {
|
|
4294
|
+
validateLocationRecordPayload(payload);
|
|
4295
|
+
const message = canonicalLocationPayload(payload);
|
|
4296
|
+
const signature = signer.type === "did:pkh" ? await signer.signMessage(message) : base64UrlEncode2(
|
|
4297
|
+
await signer.signBytes(new TextEncoder().encode(message))
|
|
4298
|
+
);
|
|
4299
|
+
return { ...payload, signature };
|
|
4300
|
+
}
|
|
4301
|
+
function validateLocationRecordPayload(input) {
|
|
4302
|
+
if (input === null || typeof input !== "object") {
|
|
4303
|
+
throw new LocationRecordValidationError("payload must be an object");
|
|
4304
|
+
}
|
|
4305
|
+
const payload = input;
|
|
4306
|
+
if (payload.version !== 1) {
|
|
4307
|
+
throw new LocationRecordValidationError("version must be 1");
|
|
4308
|
+
}
|
|
4309
|
+
validateSubject(payload.subject);
|
|
4310
|
+
validateMultiaddrs(payload.multiaddrs);
|
|
4311
|
+
if (typeof payload.updated_at !== "string" || Number.isNaN(Date.parse(payload.updated_at))) {
|
|
4312
|
+
throw new LocationRecordValidationError(
|
|
4313
|
+
"updated_at must be an ISO timestamp"
|
|
4314
|
+
);
|
|
4315
|
+
}
|
|
4316
|
+
if (typeof payload.sequence !== "number" || !Number.isSafeInteger(payload.sequence) || payload.sequence < 0) {
|
|
4317
|
+
throw new LocationRecordValidationError(
|
|
4318
|
+
"sequence must be a non-negative safe integer"
|
|
4319
|
+
);
|
|
4320
|
+
}
|
|
4321
|
+
return {
|
|
4322
|
+
version: 1,
|
|
4323
|
+
subject: payload.subject,
|
|
4324
|
+
multiaddrs: [...payload.multiaddrs],
|
|
4325
|
+
updated_at: payload.updated_at,
|
|
4326
|
+
sequence: payload.sequence
|
|
4327
|
+
};
|
|
4328
|
+
}
|
|
4329
|
+
function validateLocationRecord(input) {
|
|
4330
|
+
const payload = validateLocationRecordPayload(input);
|
|
4331
|
+
const signature = input.signature;
|
|
4332
|
+
if (typeof signature !== "string" || signature.length === 0) {
|
|
4333
|
+
throw new LocationRecordValidationError(
|
|
4334
|
+
"signature must be a non-empty string"
|
|
4335
|
+
);
|
|
4336
|
+
}
|
|
4337
|
+
return { ...payload, signature };
|
|
4338
|
+
}
|
|
4339
|
+
async function verifyLocationRecord(input) {
|
|
4340
|
+
const record = validateLocationRecord(input);
|
|
4341
|
+
const payload = canonicalLocationPayload(locationPayloadForRecord(record));
|
|
4342
|
+
if (record.subject.startsWith("did:pkh:")) {
|
|
4343
|
+
return verifyPkhSignature(record.subject, payload, record.signature);
|
|
4344
|
+
}
|
|
4345
|
+
if (record.subject.startsWith("did:key:")) {
|
|
4346
|
+
return verifyDidKeySignature(record.subject, payload, record.signature);
|
|
4347
|
+
}
|
|
4348
|
+
return false;
|
|
4349
|
+
}
|
|
4350
|
+
async function fetchLocationRecord(registryUrl, subject, fetchFn = globalThis.fetch) {
|
|
4351
|
+
const url = `${registryUrl.replace(/\/$/, "")}/v1/locations/${encodeURIComponent(subject)}`;
|
|
4352
|
+
const response = await fetchFn(url);
|
|
4353
|
+
if (response.status === 404) {
|
|
4354
|
+
return null;
|
|
4355
|
+
}
|
|
4356
|
+
if (!response.ok) {
|
|
4357
|
+
throw new Error(`location registry returned HTTP ${response.status}`);
|
|
4358
|
+
}
|
|
4359
|
+
const body = await response.json();
|
|
4360
|
+
if (body.record === void 0) {
|
|
4361
|
+
throw new LocationRecordValidationError("registry response missing record");
|
|
4362
|
+
}
|
|
4363
|
+
return validateLocationRecord(body.record);
|
|
4364
|
+
}
|
|
4365
|
+
async function resolveCloudLocation(subject, options = {}) {
|
|
4366
|
+
validateSubject(subject);
|
|
4367
|
+
const verifyRecords = options.verifyRecords ?? true;
|
|
4368
|
+
const attempts = await Promise.all([
|
|
4369
|
+
resolveExplicit(subject, options.explicitMultiaddrs),
|
|
4370
|
+
resolveBlockchain(subject, options.blockchain, verifyRecords),
|
|
4371
|
+
resolveCentralized(subject, options, verifyRecords),
|
|
4372
|
+
resolveFallback(subject, options.fallbackMultiaddrs)
|
|
4373
|
+
]);
|
|
4374
|
+
const winner = attempts.find((attempt) => attempt.candidate)?.candidate;
|
|
4375
|
+
if (!winner) {
|
|
4376
|
+
throw new CloudLocationResolutionError(subject, attempts);
|
|
4377
|
+
}
|
|
4378
|
+
return {
|
|
4379
|
+
subject,
|
|
4380
|
+
source: winner.source,
|
|
4381
|
+
multiaddrs: [...winner.multiaddrs],
|
|
4382
|
+
...winner.record ? { record: winner.record } : {},
|
|
4383
|
+
attempts,
|
|
4384
|
+
resolvedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
4385
|
+
};
|
|
4386
|
+
}
|
|
4387
|
+
async function resolveTinyCloudHosts(subject, options = {}) {
|
|
4388
|
+
const location = await resolveCloudLocation(subject, {
|
|
4389
|
+
explicitMultiaddrs: hostsToMultiaddrs(options.explicitHosts),
|
|
4390
|
+
blockchain: options.blockchain,
|
|
4391
|
+
centralizedRegistryUrl: options.registryUrl === null ? void 0 : options.registryUrl ?? DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL,
|
|
4392
|
+
fallbackMultiaddrs: hostsToMultiaddrs(
|
|
4393
|
+
options.fallbackHosts === null ? void 0 : options.fallbackHosts ?? [DEFAULT_TINYCLOUD_FALLBACK_HOST]
|
|
4394
|
+
),
|
|
4395
|
+
fetch: options.fetch,
|
|
4396
|
+
verifyRecords: options.verifyRecords
|
|
4397
|
+
});
|
|
4398
|
+
return {
|
|
4399
|
+
hosts: location.multiaddrs.map((addr) => multiaddrToHttpUrl(addr)),
|
|
4400
|
+
location
|
|
4401
|
+
};
|
|
4402
|
+
}
|
|
4403
|
+
function multiaddrToHttpUrl(input) {
|
|
4404
|
+
const uri = multiaddrToUri(multiaddr(input));
|
|
4405
|
+
if (!uri.startsWith("http://") && !uri.startsWith("https://")) {
|
|
4406
|
+
throw new LocationRecordValidationError(
|
|
4407
|
+
`multiaddr does not resolve to http/https: ${input}`
|
|
4408
|
+
);
|
|
4409
|
+
}
|
|
4410
|
+
return uri;
|
|
4411
|
+
}
|
|
4412
|
+
function httpUrlToMultiaddr(input) {
|
|
4413
|
+
const url = new URL(input);
|
|
4414
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
4415
|
+
throw new LocationRecordValidationError("URL must use http or https");
|
|
4416
|
+
}
|
|
4417
|
+
return uriToMultiaddr(url.toString()).toString();
|
|
4418
|
+
}
|
|
4419
|
+
function hostsToMultiaddrs(hosts) {
|
|
4420
|
+
if (hosts === void 0 || hosts.length === 0) {
|
|
4421
|
+
return void 0;
|
|
4422
|
+
}
|
|
4423
|
+
return hosts.map(
|
|
4424
|
+
(host) => host.startsWith("/") ? host : httpUrlToMultiaddr(host)
|
|
4425
|
+
);
|
|
4426
|
+
}
|
|
4427
|
+
async function resolveExplicit(subject, multiaddrs) {
|
|
4428
|
+
return resolveAttempt("explicit", async () => {
|
|
4429
|
+
if (multiaddrs === void 0 || multiaddrs.length === 0) {
|
|
4430
|
+
return null;
|
|
4431
|
+
}
|
|
4432
|
+
return toCandidate(subject, "explicit", multiaddrs, false);
|
|
4433
|
+
});
|
|
4434
|
+
}
|
|
4435
|
+
async function resolveBlockchain(subject, resolver, verifyRecords) {
|
|
4436
|
+
return resolveAttempt("blockchain", async () => {
|
|
4437
|
+
if (!resolver) {
|
|
4438
|
+
return null;
|
|
4439
|
+
}
|
|
4440
|
+
return toCandidate(
|
|
4441
|
+
subject,
|
|
4442
|
+
"blockchain",
|
|
4443
|
+
await resolver(subject),
|
|
4444
|
+
verifyRecords
|
|
4445
|
+
);
|
|
4446
|
+
});
|
|
4447
|
+
}
|
|
4448
|
+
async function resolveCentralized(subject, options, verifyRecords) {
|
|
4449
|
+
return resolveAttempt("centralized", async () => {
|
|
4450
|
+
if (!options.centralizedRegistryUrl) {
|
|
4451
|
+
return null;
|
|
4452
|
+
}
|
|
4453
|
+
const record = await fetchLocationRecord(
|
|
4454
|
+
options.centralizedRegistryUrl,
|
|
4455
|
+
subject,
|
|
4456
|
+
options.fetch
|
|
4457
|
+
);
|
|
4458
|
+
return toCandidate(subject, "centralized", record, verifyRecords);
|
|
4459
|
+
});
|
|
4460
|
+
}
|
|
4461
|
+
async function resolveFallback(subject, multiaddrs) {
|
|
4462
|
+
return resolveAttempt("fallback", async () => {
|
|
4463
|
+
if (multiaddrs === void 0 || multiaddrs.length === 0) {
|
|
4464
|
+
return null;
|
|
4465
|
+
}
|
|
4466
|
+
return toCandidate(subject, "fallback", multiaddrs, false);
|
|
4467
|
+
});
|
|
4468
|
+
}
|
|
4469
|
+
async function resolveAttempt(source, resolve) {
|
|
4470
|
+
try {
|
|
4471
|
+
const candidate = await resolve();
|
|
4472
|
+
return candidate ? { source, candidate } : { source };
|
|
4473
|
+
} catch (error) {
|
|
4474
|
+
return {
|
|
4475
|
+
source,
|
|
4476
|
+
error: error instanceof Error ? error : new Error(String(error))
|
|
4477
|
+
};
|
|
4478
|
+
}
|
|
4479
|
+
}
|
|
4480
|
+
async function toCandidate(subject, source, input, verifyRecord) {
|
|
4481
|
+
if (input === null || input === void 0) {
|
|
4482
|
+
return null;
|
|
4483
|
+
}
|
|
4484
|
+
if (Array.isArray(input)) {
|
|
4485
|
+
validateMultiaddrs(input);
|
|
4486
|
+
return { source, multiaddrs: [...input] };
|
|
4487
|
+
}
|
|
4488
|
+
const maybeRecord = input;
|
|
4489
|
+
if (maybeRecord.version === 1 && maybeRecord.signature !== void 0) {
|
|
4490
|
+
const record = validateLocationRecord(input);
|
|
4491
|
+
if (record.subject !== subject) {
|
|
4492
|
+
throw new LocationRecordValidationError(
|
|
4493
|
+
"location record subject does not match requested subject"
|
|
4494
|
+
);
|
|
4495
|
+
}
|
|
4496
|
+
if (verifyRecord && !await verifyLocationRecord(record)) {
|
|
4497
|
+
throw new LocationRecordValidationError(
|
|
4498
|
+
"location record signature is invalid"
|
|
4499
|
+
);
|
|
4500
|
+
}
|
|
4501
|
+
return { source, multiaddrs: [...record.multiaddrs], record };
|
|
4502
|
+
}
|
|
4503
|
+
const candidateInput = input;
|
|
4504
|
+
if (!Array.isArray(candidateInput.multiaddrs)) {
|
|
4505
|
+
throw new LocationRecordValidationError(
|
|
4506
|
+
"candidate multiaddrs must be an array"
|
|
4507
|
+
);
|
|
4508
|
+
}
|
|
4509
|
+
validateMultiaddrs(candidateInput.multiaddrs);
|
|
4510
|
+
if (candidateInput.record !== void 0) {
|
|
4511
|
+
const record = validateLocationRecord(candidateInput.record);
|
|
4512
|
+
if (record.subject !== subject) {
|
|
4513
|
+
throw new LocationRecordValidationError(
|
|
4514
|
+
"location record subject does not match requested subject"
|
|
4515
|
+
);
|
|
4516
|
+
}
|
|
4517
|
+
if (verifyRecord && !await verifyLocationRecord(record)) {
|
|
4518
|
+
throw new LocationRecordValidationError(
|
|
4519
|
+
"location record signature is invalid"
|
|
4520
|
+
);
|
|
4521
|
+
}
|
|
4522
|
+
return { source, multiaddrs: [...candidateInput.multiaddrs], record };
|
|
4523
|
+
}
|
|
4524
|
+
return { source, multiaddrs: [...candidateInput.multiaddrs] };
|
|
4525
|
+
}
|
|
4526
|
+
function validateSubject(subject) {
|
|
4527
|
+
if (typeof subject !== "string" || subject.length === 0) {
|
|
4528
|
+
throw new LocationRecordValidationError(
|
|
4529
|
+
"subject must be a non-empty string"
|
|
4530
|
+
);
|
|
4531
|
+
}
|
|
4532
|
+
if (!subject.startsWith("did:pkh:") && !subject.startsWith("did:key:")) {
|
|
4533
|
+
throw new LocationRecordValidationError(
|
|
4534
|
+
"subject must be did:pkh or did:key"
|
|
4535
|
+
);
|
|
4536
|
+
}
|
|
4537
|
+
}
|
|
4538
|
+
function validateMultiaddrs(input) {
|
|
4539
|
+
if (!Array.isArray(input)) {
|
|
4540
|
+
throw new LocationRecordValidationError("multiaddrs must be an array");
|
|
4541
|
+
}
|
|
4542
|
+
for (const addr of input) {
|
|
4543
|
+
if (typeof addr !== "string" || addr.length === 0) {
|
|
4544
|
+
throw new LocationRecordValidationError(
|
|
4545
|
+
"multiaddr entries must be non-empty strings"
|
|
4546
|
+
);
|
|
4547
|
+
}
|
|
4548
|
+
try {
|
|
4549
|
+
multiaddr(addr);
|
|
4550
|
+
} catch {
|
|
4551
|
+
throw new LocationRecordValidationError(`invalid multiaddr: ${addr}`);
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
}
|
|
4555
|
+
async function verifyPkhSignature(did, payload, signature) {
|
|
4556
|
+
const address = did.split(":").at(-1);
|
|
4557
|
+
if (!address || !/^0x[a-fA-F0-9]{40}$/.test(address)) {
|
|
4558
|
+
throw new LocationRecordValidationError(
|
|
4559
|
+
"did:pkh subject must end with an EVM address"
|
|
4560
|
+
);
|
|
4561
|
+
}
|
|
4562
|
+
if (!/^0x[0-9a-fA-F]+$/.test(signature)) {
|
|
4563
|
+
throw new LocationRecordValidationError("did:pkh signature must be hex");
|
|
4564
|
+
}
|
|
4565
|
+
return verifyMessage({
|
|
4566
|
+
address,
|
|
4567
|
+
message: payload,
|
|
4568
|
+
signature
|
|
4569
|
+
});
|
|
4570
|
+
}
|
|
4571
|
+
function verifyDidKeySignature(did, payload, signature) {
|
|
4572
|
+
const publicKey = ed25519PublicKeyFromDidKey(did);
|
|
4573
|
+
const signatureBytes = decodeBase64Url(signature);
|
|
4574
|
+
if (signatureBytes.length !== 64) {
|
|
4575
|
+
throw new LocationRecordValidationError(
|
|
4576
|
+
"did:key signature must be a base64url Ed25519 signature"
|
|
4577
|
+
);
|
|
4578
|
+
}
|
|
4579
|
+
return ed25519.verify(
|
|
4580
|
+
signatureBytes,
|
|
4581
|
+
new TextEncoder().encode(payload),
|
|
4582
|
+
publicKey
|
|
4583
|
+
);
|
|
4584
|
+
}
|
|
4585
|
+
function ed25519PublicKeyFromDidKey(did) {
|
|
4586
|
+
const identifier = did.slice("did:key:".length);
|
|
4587
|
+
if (!identifier.startsWith("z")) {
|
|
4588
|
+
throw new LocationRecordValidationError(
|
|
4589
|
+
"did:key must use base58btc multibase"
|
|
4590
|
+
);
|
|
4591
|
+
}
|
|
4592
|
+
const bytes = bases.base58btc.decode(identifier);
|
|
4593
|
+
if (bytes.length !== 34 || bytes[0] !== 237 || bytes[1] !== 1) {
|
|
4594
|
+
throw new LocationRecordValidationError(
|
|
4595
|
+
"did:key must be an Ed25519 public key"
|
|
4596
|
+
);
|
|
4597
|
+
}
|
|
4598
|
+
return bytes.slice(2);
|
|
4599
|
+
}
|
|
4600
|
+
function base64UrlEncode2(bytes) {
|
|
4601
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
4602
|
+
let output = "";
|
|
4603
|
+
for (let i = 0; i < bytes.length; i += 3) {
|
|
4604
|
+
const a = bytes[i];
|
|
4605
|
+
const b = bytes[i + 1];
|
|
4606
|
+
const c = bytes[i + 2];
|
|
4607
|
+
const triplet = a << 16 | (b ?? 0) << 8 | (c ?? 0);
|
|
4608
|
+
output += alphabet[triplet >> 18 & 63];
|
|
4609
|
+
output += alphabet[triplet >> 12 & 63];
|
|
4610
|
+
if (i + 1 < bytes.length) {
|
|
4611
|
+
output += alphabet[triplet >> 6 & 63];
|
|
4612
|
+
}
|
|
4613
|
+
if (i + 2 < bytes.length) {
|
|
4614
|
+
output += alphabet[triplet & 63];
|
|
4615
|
+
}
|
|
4616
|
+
}
|
|
4617
|
+
return output;
|
|
4618
|
+
}
|
|
4619
|
+
function decodeBase64Url(value) {
|
|
4620
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";
|
|
4621
|
+
const bytes = [];
|
|
4622
|
+
let buffer = 0;
|
|
4623
|
+
let bits = 0;
|
|
4624
|
+
for (const char of value) {
|
|
4625
|
+
const index = alphabet.indexOf(char);
|
|
4626
|
+
if (index < 0) {
|
|
4627
|
+
throw new LocationRecordValidationError(
|
|
4628
|
+
"did:key signature must be base64url"
|
|
4629
|
+
);
|
|
4630
|
+
}
|
|
4631
|
+
buffer = buffer << 6 | index;
|
|
4632
|
+
bits += 6;
|
|
4633
|
+
if (bits >= 8) {
|
|
4634
|
+
bits -= 8;
|
|
4635
|
+
bytes.push(buffer >> bits & 255);
|
|
4636
|
+
}
|
|
4637
|
+
}
|
|
4638
|
+
return Uint8Array.from(bytes);
|
|
4639
|
+
}
|
|
4640
|
+
|
|
4253
4641
|
// src/capabilities.ts
|
|
4254
4642
|
var PermissionNotInManifestError = class extends Error {
|
|
4255
4643
|
constructor(missing, granted) {
|
|
@@ -4370,10 +4758,13 @@ export {
|
|
|
4370
4758
|
CapabilityKeyRegistry,
|
|
4371
4759
|
CapabilityKeyRegistryErrorCodes,
|
|
4372
4760
|
ClientSessionSchema,
|
|
4761
|
+
CloudLocationResolutionError,
|
|
4373
4762
|
DEFAULT_DEFAULTS,
|
|
4374
4763
|
DEFAULT_EXPIRY,
|
|
4375
4764
|
DEFAULT_MANIFEST_SPACE,
|
|
4376
4765
|
DEFAULT_MANIFEST_VERSION,
|
|
4766
|
+
DEFAULT_TINYCLOUD_FALLBACK_HOST,
|
|
4767
|
+
DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL,
|
|
4377
4768
|
DataVaultService,
|
|
4378
4769
|
DatabaseHandle,
|
|
4379
4770
|
DelegationErrorCodes,
|
|
@@ -4385,6 +4776,7 @@ export {
|
|
|
4385
4776
|
ErrorCodes2 as ErrorCodes,
|
|
4386
4777
|
HooksService2 as HooksService,
|
|
4387
4778
|
KVService2 as KVService,
|
|
4779
|
+
LocationRecordValidationError,
|
|
4388
4780
|
ManifestValidationError,
|
|
4389
4781
|
PermissionNotInManifestError,
|
|
4390
4782
|
PrefixedKVService,
|
|
@@ -4410,6 +4802,7 @@ export {
|
|
|
4410
4802
|
activateSessionWithHost,
|
|
4411
4803
|
applyPrefix,
|
|
4412
4804
|
buildSpaceUri,
|
|
4805
|
+
canonicalLocationPayload,
|
|
4413
4806
|
checkNodeInfo,
|
|
4414
4807
|
composeManifestRequest,
|
|
4415
4808
|
createCapabilityKeyRegistry,
|
|
@@ -4421,23 +4814,33 @@ export {
|
|
|
4421
4814
|
defaultSpaceCreationHandler,
|
|
4422
4815
|
err4 as err,
|
|
4423
4816
|
expandActionShortNames,
|
|
4817
|
+
fetchLocationRecord,
|
|
4424
4818
|
fetchPeerId,
|
|
4819
|
+
httpUrlToMultiaddr,
|
|
4425
4820
|
isCapabilitySubset,
|
|
4426
4821
|
loadManifest,
|
|
4822
|
+
locationPayloadForRecord,
|
|
4427
4823
|
makePublicSpaceId,
|
|
4428
4824
|
manifestAbilitiesUnion,
|
|
4825
|
+
multiaddrToHttpUrl,
|
|
4429
4826
|
normalizeDefaults,
|
|
4430
4827
|
ok4 as ok,
|
|
4431
4828
|
parseExpiry,
|
|
4432
4829
|
parseRecapCapabilities,
|
|
4433
4830
|
parseSpaceUri,
|
|
4831
|
+
resolveCloudLocation,
|
|
4434
4832
|
resolveManifest,
|
|
4833
|
+
resolveTinyCloudHosts,
|
|
4435
4834
|
resourceCapabilitiesToAbilitiesMap,
|
|
4436
4835
|
resourceCapabilitiesToSpaceAbilitiesMap,
|
|
4437
4836
|
serviceError4 as serviceError,
|
|
4837
|
+
signLocationRecord,
|
|
4438
4838
|
submitHostDelegation,
|
|
4439
4839
|
validateClientSession,
|
|
4840
|
+
validateLocationRecord,
|
|
4841
|
+
validateLocationRecordPayload,
|
|
4440
4842
|
validateManifest,
|
|
4441
|
-
validatePersistedSessionData
|
|
4843
|
+
validatePersistedSessionData,
|
|
4844
|
+
verifyLocationRecord
|
|
4442
4845
|
};
|
|
4443
4846
|
//# sourceMappingURL=index.js.map
|