import type { TupleToUnion } from 'type-fest'; import * as Ucanto from '@ucanto/interface'; import type { Schema } from '@ucanto/core'; import { InferInvokedCapability, Unit, DID, DIDKey, ToString, Link, Failure, UnknownLink } from '@ucanto/interface'; import { CAR } from '@ucanto/transport'; import { Phantom, PieceLink, ProofData, uint64 } from '@web3-storage/data-segment'; import * as AssertCaps from './assert.js'; import * as ClaimCaps from './claim.js'; import * as SpaceCaps from './space.js'; import * as provider from './provider.js'; import { top } from './top.js'; import * as BlobCaps from './blob/index.js'; import * as BlobReplicaCaps from './blob/replica/index.js'; import * as SpaceBlobCaps from './space/blob.js'; import * as W3sBlobCaps from './web3.storage/blob.js'; import * as HTTPCaps from './http.js'; import * as StoreCaps from './store.js'; import * as UploadCaps from './upload.js'; import * as UploadShardCaps from './upload/shard.js'; import * as AccessCaps from './access.js'; import * as CustomerCaps from './customer.js'; import * as ConsumerCaps from './consumer.js'; import * as SubscriptionCaps from './subscription.js'; import * as RateLimitCaps from './rate-limit.js'; import * as StorefrontCaps from './filecoin/storefront.js'; import * as AggregatorCaps from './filecoin/aggregator.js'; import * as DealTrackerCaps from './filecoin/deal-tracker.js'; import * as DealerCaps from './filecoin/dealer.js'; import * as SpaceIndexCaps from './space/index.js'; import * as AdminCaps from './admin.js'; import * as UCANCaps from './ucan.js'; import * as PlanCaps from './plan.js'; import * as UsageCaps from './usage.js'; import * as AccountUsageCaps from './account/usage.js'; import * as AccountEgressCaps from './account/egress.js'; import * as PDPCaps from './pdp.js'; export type ISO8601Date = string; export type { Unit, PieceLink }; export interface UCANAwait { 'ucan/await': [Selector, Link]; } /** * An IPLD Link that has the CAR codec code. */ export type CARLink = Link; export type Multihash = Uint8Array; export type AccountDID = DID<'mailto'>; export type SpaceDID = DID<'key'>; /** * Error for cases where an interface implementation needs to return an * error that isn't defined explicitly in the interface. */ export interface UnexpectedError extends Ucanto.Failure { name: 'UnexpectedError'; cause: unknown; } /** * failure due to a resource not having enough storage capacity. */ export interface InsufficientStorage { name: 'InsufficientStorage'; message: string; } export interface UnknownProvider extends Failure { name: 'UnknownProvider'; did: DID; } /** * @see https://github.com/filecoin-project/FIPs/pull/758/files */ export type PieceLinkSchema = Schema.Schema; export type Access = InferInvokedCapability; export type AccessAuthorize = InferInvokedCapability; export interface AccessAuthorizeSuccess { request: Link; expiration: number; } export interface AccessAuthorizeFailure extends Ucanto.Failure { } export type AccessClaim = InferInvokedCapability; export interface AccessClaimSuccess { delegations: Record>; } export interface AccessClaimFailure extends Ucanto.Failure { name: 'AccessClaimFailure'; message: string; } export interface AccessConfirmSuccess { delegations: Record>; } export interface AccessConfirmFailure extends Ucanto.Failure { } export type AccessDelegate = InferInvokedCapability; export type AccessDelegateSuccess = Unit; export type AccessDelegateFailure = InsufficientStorage | DelegationNotFound; export interface DelegationNotFound extends Ucanto.Failure { name: 'DelegationNotFound'; } export type AccessConfirm = InferInvokedCapability; export type Assert = InferInvokedCapability; export type AssertEquals = InferInvokedCapability; export type AssertInclusion = InferInvokedCapability; export type AssertIndex = InferInvokedCapability; export type AssertLocation = InferInvokedCapability; export type AssertPartition = InferInvokedCapability; export type AssertRelation = InferInvokedCapability; export type Claim = InferInvokedCapability; export type ClaimCache = InferInvokedCapability; export type Usage = InferInvokedCapability; export type UsageReport = InferInvokedCapability; export type UsageReportSuccess = Record; export type UsageReportFailure = Ucanto.Failure; export interface UsageData { /** Provider the report concerns, e.g. `did:web:storacha.network` */ provider: ProviderDID; /** Space the report concerns. */ space: SpaceDID; /** Period the report applies to. */ period: { /** ISO datetime the report begins from (inclusive). */ from: ISO8601Date; /** ISO datetime the report ends at (inclusive). */ to: ISO8601Date; }; /** Observed space size for the period. */ size: { /** Size at the beginning of the report period. */ initial: number; /** Size at the end of the report period. */ final: number; }; /** Events that caused the size to change during the period. */ events: Array<{ /** CID of the invoked task that caused the size to change. */ cause: Link; /** Number of bytes that were added or removed. */ delta: number; /** ISO datetime that the receipt was issued for the change. */ receiptAt: ISO8601Date; }>; } export interface EgressData { /** The space which contains the resource that was served. */ space: SpaceDID; /** The customer that is being billed for the egress traffic. */ customer: AccountDID; /** CID of the resource that was served it's the CID of some gateway accessible content. It is not the CID of a blob/shard.*/ resource: UnknownLink; /** Amount of bytes served. */ bytes: number; /** ISO datetime that the bytes were served at. */ servedAt: ISO8601Date; /** Identifier of the invocation that caused the egress traffic. */ cause: UnknownLink; } export interface EgressUsageData { /** Provider the report concerns, e.g. `did:web:storacha.network` */ provider: ProviderDID; /** Space the report concerns. */ space: SpaceDID; /** Period the report applies to. */ period: { /** ISO datetime the report begins from (inclusive). */ from: ISO8601Date; /** ISO datetime the report ends at (inclusive). */ to: ISO8601Date; }; /** Total bytes served during the period. */ total: number; } export type AccountUsage = InferInvokedCapability; export type AccountUsageGet = InferInvokedCapability; export interface NoSubscriptionError extends Ucanto.Failure { name: 'NoSubscription'; } export type AccountUsageGetFailure = NoSubscriptionError | Ucanto.Failure; export interface AccountUsageGetSuccess { total: number; spaces: Record; egress: { total: number; spaces: Record; }; } export interface SpaceUsage { total: number; providers: Record; } export interface SpaceEgressUsage { total: number; providers: Record; } export type AccountEgress = InferInvokedCapability; export type AccountEgressGet = InferInvokedCapability; export interface AccountNotFoundError extends Ucanto.Failure { name: 'AccountNotFound'; } export interface SpaceUnauthorizedError extends Ucanto.Failure { name: 'SpaceUnauthorized'; } export interface PeriodNotAcceptableError extends Ucanto.Failure { name: 'PeriodNotAcceptable'; } export type AccountEgressGetFailure = AccountNotFoundError | SpaceUnauthorizedError | PeriodNotAcceptableError | Ucanto.Failure; export interface AccountEgressGetSuccess { total: number; spaces: Record; } export interface SpaceEgress { total: number; dailyStats: DailyStats[]; } export interface DailyStats { date: ISO8601Date; egress: number; } export type ProviderAdd = InferInvokedCapability; export interface ProviderAddSuccess { } export type ProviderAddFailure = InvalidProvider | Ucanto.Failure; export type ProviderDID = DID<'web'>; export interface InvalidProvider extends Ucanto.Failure { name: 'InvalidProvider'; } export type CustomerGet = InferInvokedCapability; export interface CustomerGetSuccess { did: AccountDID; subscriptions: string[]; } export interface CustomerNotFound extends Ucanto.Failure { name: 'CustomerNotFound'; } export type CustomerGetFailure = CustomerNotFound | Ucanto.Failure; export type ConsumerHas = InferInvokedCapability; export type ConsumerHasSuccess = boolean; export type ConsumerHasFailure = Ucanto.Failure; export type ConsumerGet = InferInvokedCapability; export interface ConsumerGetSuccess { did: DIDKey; allocated: number; limit: number; subscription: string; customer: AccountDID; } export interface ConsumerNotFound extends Ucanto.Failure { name: 'ConsumerNotFound'; } export type ConsumerGetFailure = ConsumerNotFound | Ucanto.Failure; export type SubscriptionGet = InferInvokedCapability; export interface SubscriptionGetSuccess { customer: AccountDID; consumer?: DIDKey; } export interface SubscriptionNotFound extends Ucanto.Failure { name: 'SubscriptionNotFound'; } export type SubscriptionGetFailure = SubscriptionNotFound | UnknownProvider | Ucanto.Failure; export type SubscriptionList = InferInvokedCapability; export interface SubscriptionListSuccess { results: Array; } export interface SubscriptionListItem { subscription: string; provider: ProviderDID; consumers: SpaceDID[]; } export type SubscriptionListFailure = Ucanto.Failure; export type RateLimitAdd = InferInvokedCapability; export interface RateLimitAddSuccess { id: string; } export type RateLimitAddFailure = Ucanto.Failure; export type RateLimitRemove = InferInvokedCapability; export type RateLimitRemoveSuccess = Unit; export interface RateLimitsNotFound extends Ucanto.Failure { name: 'RateLimitsNotFound'; } export type RateLimitRemoveFailure = RateLimitsNotFound | Ucanto.Failure; export type RateLimitList = InferInvokedCapability; export interface RateLimitSubject { id: string; rate: number; } export interface RateLimitListSuccess { limits: RateLimitSubject[]; } export type RateLimitListFailure = Ucanto.Failure; export type Space = InferInvokedCapability; export type SpaceInfo = InferInvokedCapability; export type SpaceContentServe = InferInvokedCapability; export type SpaceEncryptionSetup = InferInvokedCapability; export type SpaceEncryptionKeyDecrypt = InferInvokedCapability; export type SpaceDecrypt = InferInvokedCapability; /** * Successful result for the `space/encryption/setup` capability. * * Returned when encryption is initialised (or already set up) for a Space. * The public key can be used by clients to wrap per-file Data Encryption Keys * (DEKs) before uploading. */ export interface SpaceEncryptionSetupSuccess { /** PEM-encoded RSA public key for wrapping Data Encryption Keys (DEKs). */ publicKey: string; /** KMS provider identifier (e.g. `'storacha'`). */ provider: string; /** Key-wrapping algorithm used by the KMS (e.g. `'RSA-OAEP-256'`). */ algorithm: string; } /** * Failure type for the `space/encryption/setup` capability. */ export type SpaceEncryptionSetupFailure = Ucanto.Failure; /** * Successful result for the `space/encryption/key/decrypt` capability. * * Returned when the KMS successfully unwraps a wrapped Data Encryption Key * (DEK) for an authorised caller. */ export interface SpaceEncryptionKeyDecryptSuccess { /** Base64-encoded decrypted Data Encryption Key (DEK). */ decryptedSymmetricKey: string; } /** * Failure type for the `space/encryption/key/decrypt` capability. */ export type SpaceEncryptionKeyDecryptFailure = Ucanto.Failure; /** * Successful result for the `space/content/decrypt` capability. * * This capability is a delegation proof — success indicates the invocation is * authorised to decrypt the referenced resource. */ export type SpaceDecryptSuccess = Unit; /** * Failure type for the `space/content/decrypt` capability. */ export type SpaceDecryptFailure = Ucanto.Failure; export type EgressRecord = InferInvokedCapability; export type EgressRecordSuccess = { space: SpaceDID; resource: UnknownLink; bytes: number; servedAt: ISO8601Date; cause: UnknownLink; }; export type EgressRecordFailure = ConsumerNotFound | Ucanto.Failure; export interface DealMetadata { dataType: uint64; dataSource: SingletonMarketSource; } /** @see https://github.com/filecoin-project/go-data-segment/blob/e3257b64fa2c84e0df95df35de409cfed7a38438/datasegment/verifier.go#L8-L14 */ export interface DataAggregationProof { /** * Proof the piece is included in the aggregate. */ inclusion: InclusionProof; /** * Filecoin deal metadata. */ aux: DealMetadata; } /** @see https://github.com/filecoin-project/go-data-segment/blob/e3257b64fa2c84e0df95df35de409cfed7a38438/datasegment/inclusion.go#L30-L39 */ export interface InclusionProof { /** * Proof of inclusion of the client's data segment in the data aggregator's * Merkle tree (includes position information). i.e. a proof that the root * node of the subtree containing all the nodes (leafs) of a data segment is * contained in CommDA. */ subtree: ProofData; /** * Proof that an entry for the user's data is contained in the index of the * aggregator's deal. i.e. a proof that the data segment index constructed * from the root of the user's data segment subtree is contained in the index * of the deal tree. */ index: ProofData; } export interface SingletonMarketSource { dealID: uint64; } export interface FilecoinOfferSuccess { /** * Commitment proof for piece. */ piece: PieceLink; } export type FilecoinOfferFailure = ContentNotFound | Ucanto.Failure; export interface ContentNotFound extends Ucanto.Failure { name: 'ContentNotFound'; content: Link; } export interface FilecoinSubmitSuccess { /** * Commitment proof for piece. */ piece: PieceLink; } export type FilecoinSubmitFailure = InvalidPieceCID | Ucanto.Failure; export interface FilecoinAcceptSuccess extends DataAggregationProof { aggregate: PieceLink; piece: PieceLink; } export type FilecoinAcceptFailure = InvalidContentPiece | ProofNotFound | Ucanto.Failure; export interface InvalidContentPiece extends Ucanto.Failure { name: 'InvalidContentPiece'; content: PieceLink; } export interface ProofNotFound extends Ucanto.Failure { name: 'ProofNotFound'; } export interface FilecoinInfoSuccess { piece: PieceLink; aggregates: FilecoinInfoAcceptedAggregate[]; deals: FilecoinInfoAcceptedDeal[]; } export interface FilecoinInfoAcceptedAggregate { /** * Aggregate piece CID. */ aggregate: PieceLink; /** * Proof the piece is included in the aggregate. */ inclusion: InclusionProof; } export interface FilecoinInfoAcceptedDeal extends Omit, DealDetails { aggregate: PieceLink; } export type FilecoinInfoFailure = ContentNotFound | InvalidContentPiece | Ucanto.Failure; export interface PieceOfferSuccess { /** * Commitment proof for piece. */ piece: PieceLink; } export type PieceOfferFailure = Ucanto.Failure; export interface PieceAcceptSuccess { /** * Commitment proof for piece. */ piece: PieceLink; /** * Commitment proof for aggregate. */ aggregate: PieceLink; /** * Proof the piece is included in the aggregate. */ inclusion: InclusionProof; } export type PieceAcceptFailure = Ucanto.Failure; export interface AggregateOfferSuccess { /** * Commitment proof for aggregate. */ aggregate: PieceLink; } export type AggregateOfferFailure = Ucanto.Failure; export interface AggregateAcceptSuccess extends DealMetadata { aggregate: PieceLink; } export type AggregateAcceptFailure = InvalidPiece | Ucanto.Failure; export interface InvalidPiece extends Ucanto.Failure { name: 'InvalidPiece'; /** * Commitment proof for aggregate. */ aggregate: PieceLink; cause: InvalidPieceCID[]; } export interface InvalidPieceCID extends Ucanto.Failure { name: 'InvalidPieceCID'; piece: PieceLink; } export interface DealInfoSuccess { deals: Record, DealDetails>; } export interface DealDetails { provider: FilecoinAddress; } export type FilecoinAddress = string; export type DealInfoFailure = DealNotFound | Ucanto.Failure; export interface DealNotFound extends Ucanto.Failure { name: 'DealNotFound'; } export type Upload = InferInvokedCapability; export type UploadAdd = InferInvokedCapability; export type UploadGet = InferInvokedCapability; export type UploadRemove = InferInvokedCapability; export type UploadList = InferInvokedCapability; export interface UploadNotFound extends Ucanto.Failure { name: 'UploadNotFound'; } export type UploadGetFailure = UploadNotFound | Ucanto.Failure; export type UploadShard = InferInvokedCapability; export type UploadShardList = InferInvokedCapability; export type UploadShardListFailure = UploadNotFound | Ucanto.Failure; export type HTTPPut = InferInvokedCapability; export type SpaceIndex = InferInvokedCapability; export type SpaceIndexAdd = InferInvokedCapability; export type SpaceIndexAddSuccess = Unit; export type SpaceIndexAddFailure = IndexNotFound | DecodeFailure | UnknownFormat | ShardNotFound | SliceNotFound | RetrievalAuthorizationNotFound | InvalidRetrievalAuthorization | PublishFailure | Failure; /** An error occurred when decoding the data. */ export interface DecodeFailure extends Failure { name: 'DecodeFailure'; } /** The data is not in a format understood by the service. */ export interface UnknownFormat extends Failure { name: 'UnknownFormat'; } /** The index is not stored in the referenced space. */ export interface IndexNotFound extends Failure { name: 'IndexNotFound'; /** Multihash digest of the index that could not be found. */ digest: Multihash; } /** A shard referenced by the index is not stored in the referenced space. */ export interface ShardNotFound extends Failure { name: 'ShardNotFound'; /** Multihash digest of the shard that could not be found. */ digest: Multihash; } /** A slice referenced by the index was not found in the specified shard. */ export interface SliceNotFound extends Failure { name: 'SliceNotFound'; /** Multihash digest of the slice that could not be found. */ digest: Multihash; } /** Publshing the index to underlying systems failed. */ export interface PublishFailure extends Failure { name: 'PublishFailure'; cause: Failure; } /** A retrieval authorization for the blob was not found. */ export interface RetrievalAuthorizationNotFound extends Failure { name: 'RetrievalAuthorizationNotFound'; } /** A retrieval authorization for the blob was invalid. */ export interface InvalidRetrievalAuthorization extends Failure { name: 'InvalidRetrievalAuthorization'; } export type Blob = InferInvokedCapability; export type BlobAllocate = InferInvokedCapability; export type BlobAccept = InferInvokedCapability; export type BlobReplica = InferInvokedCapability; export type BlobReplicaAllocate = InferInvokedCapability; export type BlobReplicaTransfer = InferInvokedCapability; export type SpaceBlob = InferInvokedCapability; export type SpaceBlobAdd = InferInvokedCapability; export type SpaceBlobRemove = InferInvokedCapability; export type SpaceBlobList = InferInvokedCapability; export type SpaceBlobGet = InferInvokedCapability; export type SpaceBlobReplicate = InferInvokedCapability; /** @deprecated */ export type W3sBlob = InferInvokedCapability; /** @deprecated */ export type W3sBlobAllocate = InferInvokedCapability; /** @deprecated */ export type W3sBlobAccept = InferInvokedCapability; export interface BlobModel { digest: Multihash; size: number; } export interface SpaceBlobAddSuccess { site: UCANAwait<'.out.ok.site'>; } export interface BlobSizeOutsideOfSupportedRange extends Ucanto.Failure { name: 'BlobSizeOutsideOfSupportedRange'; } export interface AwaitError extends Ucanto.Failure { name: 'AwaitError'; } export type SpaceBlobAddFailure = BlobSizeOutsideOfSupportedRange | AwaitError | StorageGetError | Ucanto.Failure; export interface BlobItem { blob: BlobModel; cause: Link; insertedAt: ISO8601Date; } export interface SpaceBlobRemoveSuccess { size: number; } export type SpaceBlobRemoveFailure = Ucanto.Failure; export interface SpaceBlobListSuccess extends ListResponse { } export type SpaceBlobListFailure = Ucanto.Failure; export interface SpaceBlobGetSuccess extends BlobItem { } export type SpaceBlobGetFailure = Ucanto.Failure; export interface SpaceBlobReplicateSuccess { site: UCANAwait<'.out.ok.site'>[]; } /** Too many or too few replicas were instructed. */ export interface ReplicationCountRangeError extends Failure { name: 'ReplicationCountRangeError'; } /** There are not enough replication nodes available to replicate the data. */ export interface ReplicationCandidateUnavailable extends Failure { name: 'ReplicationCandidateUnavailable'; } /** Blob to replicate was not found in the space. */ export interface ReplicationSourceNotFound extends Failure { name: 'ReplicationSourceNotFound'; } /** * The location commitment was invalid in some way. For example, it has expired, * is revoked, had a signature that did not verify or referenced a blob that was * not requested to be replicated. */ export interface InvalidReplicationSite extends Failure { name: 'InvalidReplicationSite'; } export type SpaceBlobReplicateFailure = ReplicationCountRangeError | ReplicationCandidateUnavailable | ReplicationSourceNotFound | InvalidReplicationSite | Failure; export interface BlobAllocateSuccess { size: number; address?: BlobAddress; } export interface BlobAddress { url: ToString; headers: Record; expires: number; } export interface NotEnoughStorageCapacity extends Ucanto.Failure { name: 'NotEnoughStorageCapacity'; } export type BlobAllocateFailure = NotEnoughStorageCapacity | Ucanto.Failure; export interface BlobAcceptSuccess { site: Link; PDP?: Link; } export interface AllocatedMemoryHadNotBeenWrittenTo extends Ucanto.Failure { name: 'AllocatedMemoryHadNotBeenWrittenTo'; } export type BlobAcceptFailure = AllocatedMemoryHadNotBeenWrittenTo | Ucanto.Failure; export interface BlobReplicaAllocateSuccess { size: number; site: UCANAwait<'.out.ok.site'>; } export type BlobReplicaAllocateFailure = Failure; export interface BlobReplicaTransferSuccess { site: Link; } export type BlobReplicaTransferFailure = Failure; export type StoragePutError = StorageOperationError; export type StorageGetError = StorageOperationError | RecordNotFound; export interface StorageOperationError extends Error { name: 'StorageOperationFailed'; } export interface RecordNotFound extends Error { name: 'RecordNotFound'; } /** @deprecated */ export type Store = InferInvokedCapability; /** @deprecated */ export type StoreGet = InferInvokedCapability; /** @deprecated */ export type StoreRemove = InferInvokedCapability; /** @deprecated */ export type StoreList = InferInvokedCapability; /** @deprecated */ export interface StoreRemoveSuccess { size: number; } /** @deprecated */ export interface StoreItemNotFound extends Ucanto.Failure { name: 'StoreItemNotFound'; } /** @deprecated */ export type StoreRemoveFailure = StoreItemNotFound | Ucanto.Failure; /** @deprecated */ export type StoreGetSuccess = StoreListItem; /** @deprecated */ export type StoreGetFailure = StoreItemNotFound | Ucanto.Failure; /** @deprecated */ export interface StoreListSuccess extends ListResponse { } /** A page of results from a paginated listing or query. */ export interface ResultPage { cursor?: string; size: number; results: R[]; } /** A bi-directional page of results from a paginated listing or query. */ export interface ListResponse extends ResultPage { before?: string; after?: string; } /** @deprecated */ export interface StoreListItem { link: CARLink; size: number; origin?: UnknownLink; insertedAt: ISO8601Date; } export interface UploadListItem { root: UnknownLink; insertedAt: ISO8601Date; updatedAt: ISO8601Date; } export type UploadAddSuccess = Omit; export type UploadGetSuccess = UploadListItem; export type UploadRemoveSuccess = UploadAddSuccess; export interface UploadListSuccess extends ListResponse { } export interface UploadShardListSuccess extends ResultPage { } export type UCANRevoke = InferInvokedCapability; export type UCANAttest = InferInvokedCapability; export type UCANConclude = InferInvokedCapability; export interface Timestamp { /** * Unix timestamp in seconds. */ time: number; } export type UCANRevokeSuccess = Timestamp; export type UCANConcludeSuccess = Timestamp; /** * Error is raised when `UCAN` being revoked is not supplied or it's proof chain * leading to supplied `scope` is not supplied. */ export interface UCANNotFound extends Ucanto.Failure { name: 'UCANNotFound'; } /** * Error is raised when `UCAN` being revoked does not have provided `scope` in * the proof chain. */ export interface InvalidRevocationScope extends Ucanto.Failure { name: 'InvalidRevocationScope'; } /** * Error is raised when `UCAN` revocation is issued by unauthorized principal, * that is `with` field is not an `iss` of the `scope`. */ export interface UnauthorizedRevocation extends Ucanto.Failure { name: 'UnauthorizedRevocation'; } /** * Error is raised when `UCAN` revocation cannot be stored. This * is usually not a client error. */ export interface RevocationsStoreFailure extends Ucanto.Failure { name: 'RevocationsStoreFailure'; } export type UCANRevokeFailure = UCANNotFound | InvalidRevocationScope | UnauthorizedRevocation | RevocationsStoreFailure; /** * Error is raised when receipt is received for unknown invocation */ export interface ReferencedInvocationNotFound extends Ucanto.Failure { name: 'ReferencedInvocationNotFound'; } export type UCANConcludeFailure = ReferencedInvocationNotFound | Ucanto.Failure; export type Admin = InferInvokedCapability; export type AdminUploadInspect = InferInvokedCapability; export type AdminStoreInspect = InferInvokedCapability; export interface SpaceAdmin { did: DID; insertedAt: string; } export interface AdminUploadInspectSuccess { spaces: SpaceAdmin[]; } export type AdminUploadInspectFailure = Ucanto.Failure; export interface AdminStoreInspectSuccess { spaces: SpaceAdmin[]; } export type AdminStoreInspectFailure = Ucanto.Failure; export type Filecoin = InferInvokedCapability; export type FilecoinOffer = InferInvokedCapability; export type FilecoinSubmit = InferInvokedCapability; export type FilecoinAccept = InferInvokedCapability; export type FilecoinInfo = InferInvokedCapability; export type PieceOffer = InferInvokedCapability; export type PieceAccept = InferInvokedCapability; export type AggregateOffer = InferInvokedCapability; export type AggregateAccept = InferInvokedCapability; export type DealInfo = InferInvokedCapability; export type PDPAccept = InferInvokedCapability; export type PDPInfo = InferInvokedCapability; export interface PDPAcceptSuccess { /** * CID of the aggregate piece containing the blob. */ aggregate: PieceLink; /** * Proof the blob is included in the aggregate. */ inclusionProof: ProofData; /** * CID of the piece. */ piece: PieceLink; } export type PDPAcceptFailure = Ucanto.Failure; export interface PDPInfoAcceptedAggregate { /** * CID of the aggregate piece. */ aggregate: PieceLink; /** * Proof the blob is included in the aggregate. */ inclusionProof: ProofData; } export interface PDPInfoSuccess { /** * CID of the piece. */ piece: PieceLink; /** * List of aggregates containing the blob with inclusion proofs. */ aggregates: PDPInfoAcceptedAggregate[]; } export type PDPInfoFailure = Ucanto.Failure; export type PlanGet = InferInvokedCapability; export interface PlanGetSuccess { updatedAt: ISO8601Date; product: DID; limit: string; } export interface PlanNotFound extends Ucanto.Failure { name: 'PlanNotFound'; } export interface MissingCapacity extends Ucanto.Failure { name: 'MissingCapacity'; } export type PlanGetFailure = PlanNotFound | MissingCapacity | UnexpectedError; export type PlanSet = InferInvokedCapability; export type PlanSetSuccess = Unit; /** * @deprecate currently unused - used to be part of PlanSetFailure but we switched to CustomerNotFound */ export interface AccountNotFound extends Ucanto.Failure { name: 'AccountNotFound'; } export interface InvalidPlanName extends Ucanto.Failure { name: 'InvalidPlanName'; } export interface PlanUpdateError extends Ucanto.Failure { name: 'PlanUpdateError'; } export type PlanSetFailure = CustomerNotFound | PlanUpdateError | UnexpectedError; export type PlanCreateAdminSession = InferInvokedCapability; export interface PlanCreateAdminSessionSuccess { url: string; } export interface AdminSessionNotSupported extends Ucanto.Failure { name: 'AdminSessionNotSupported'; } export type PlanCreateAdminSessionFailure = AdminSessionNotSupported | CustomerNotFound | UnexpectedError; export type PlanCreateCheckoutSession = InferInvokedCapability; export interface PlanCreateCheckoutSessionSuccess { url: string; } export interface SessionCreationError extends Ucanto.Failure { name: 'SessionCreationError'; } export interface PlanNotFound extends Ucanto.Failure { name: 'PlanNotFound'; } export interface CustomerExists extends Ucanto.Failure { name: 'CustomerExists'; } export type PlanCreateCheckoutSessionFailure = CustomerExists | SessionCreationError | PlanNotFound | UnexpectedError; export type Top = InferInvokedCapability; export type ServiceAbility = TupleToUnion; export type ServiceAbilityArray = [ Top['can'], Assert['can'], AssertEquals['can'], AssertInclusion['can'], AssertIndex['can'], AssertLocation['can'], AssertPartition['can'], AssertRelation['can'], Claim['can'], ClaimCache['can'], ProviderAdd['can'], Space['can'], SpaceInfo['can'], SpaceContentServe['can'], SpaceEncryptionSetup['can'], SpaceEncryptionKeyDecrypt['can'], SpaceDecrypt['can'], EgressRecord['can'], Upload['can'], UploadAdd['can'], UploadGet['can'], UploadRemove['can'], UploadList['can'], UploadShard['can'], UploadShardList['can'], Store['can'], StoreGet['can'], StoreRemove['can'], StoreList['can'], Access['can'], AccessAuthorize['can'], UCANAttest['can'], UCANConclude['can'], CustomerGet['can'], ConsumerHas['can'], ConsumerGet['can'], SubscriptionGet['can'], SubscriptionList['can'], RateLimitAdd['can'], RateLimitRemove['can'], RateLimitList['can'], Filecoin['can'], FilecoinOffer['can'], FilecoinSubmit['can'], FilecoinAccept['can'], FilecoinInfo['can'], PieceOffer['can'], PieceAccept['can'], AggregateOffer['can'], AggregateAccept['can'], DealInfo['can'], Admin['can'], AdminUploadInspect['can'], AdminStoreInspect['can'], PlanGet['can'], PlanSet['can'], PlanCreateAdminSession['can'], Usage['can'], UsageReport['can'], Blob['can'], BlobAllocate['can'], BlobAccept['can'], BlobReplica['can'], BlobReplicaAllocate['can'], BlobReplicaTransfer['can'], SpaceBlob['can'], SpaceBlobAdd['can'], SpaceBlobRemove['can'], SpaceBlobList['can'], SpaceBlobGet['can'], SpaceBlobReplicate['can'], W3sBlob['can'], W3sBlobAllocate['can'], W3sBlobAccept['can'], HTTPPut['can'], SpaceIndex['can'], SpaceIndexAdd['can'], AccountUsage['can'], AccountUsageGet['can'], AccountEgress['can'], AccountEgressGet['can'], PDPAccept['can'], PDPInfo['can'] ]; /** * @deprecated use ServiceAbility */ export type Abilities = ServiceAbility; /** * @deprecated use ServiceAbilityArray */ export type AbilitiesArray = ServiceAbilityArray; //# sourceMappingURL=types.d.ts.map