@web3-storage/capabilities
Advanced tools
Comparing version 11.2.0 to 11.3.0
@@ -1,2 +0,2 @@ | ||
export { filecoinOffer as offer, filecoinSubmit as submit, filecoinAccept as accept } from "./storefront.js"; | ||
export { filecoinOffer as offer, filecoinSubmit as submit, filecoinAccept as accept, filecoinInfo as info } from "./storefront.js"; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -31,3 +31,12 @@ /** | ||
}>>>; | ||
/** | ||
* Capability allowing an agent to _request_ info about a content piece in | ||
* Filecoin deals. | ||
*/ | ||
export const filecoinInfo: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"filecoin/info", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{ | ||
protocol: "did:"; | ||
}>, Schema.InferStruct<{ | ||
piece: import("../types.js").PieceLinkSchema; | ||
}>>>; | ||
import { Schema } from '@ucanto/validator'; | ||
//# sourceMappingURL=storefront.d.ts.map |
@@ -236,2 +236,10 @@ import type { TupleToUnion } from 'type-fest'; | ||
} | ||
export interface FilecoinInfoSuccess { | ||
piece: PieceLink; | ||
deals: FilecoinInfoAcceptedDeal[]; | ||
} | ||
export interface FilecoinInfoAcceptedDeal extends DataAggregationProof, DealDetails { | ||
aggregate: PieceLink; | ||
} | ||
export type FilecoinInfoFailure = ContentNotFound | InvalidContentPiece | Ucanto.Failure; | ||
export interface PieceOfferSuccess { | ||
@@ -419,2 +427,3 @@ /** | ||
export type FilecoinAccept = InferInvokedCapability<typeof StorefrontCaps.filecoinAccept>; | ||
export type FilecoinInfo = InferInvokedCapability<typeof StorefrontCaps.filecoinInfo>; | ||
export type PieceOffer = InferInvokedCapability<typeof AggregatorCaps.pieceOffer>; | ||
@@ -464,2 +473,3 @@ export type PieceAccept = InferInvokedCapability<typeof AggregatorCaps.pieceAccept>; | ||
FilecoinAccept['can'], | ||
FilecoinInfo['can'], | ||
PieceOffer['can'], | ||
@@ -466,0 +476,0 @@ PieceAccept['can'], |
{ | ||
"name": "@web3-storage/capabilities", | ||
"version": "11.2.0", | ||
"version": "11.3.0", | ||
"description": "Capabilities provided by web3.storage", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/web3-storage/w3protocol/tree/main/packages/capabilities", |
@@ -19,2 +19,3 @@ /** | ||
filecoinAccept as accept, | ||
filecoinInfo as info, | ||
} from './storefront.js' |
@@ -109,1 +109,28 @@ /** | ||
}) | ||
/** | ||
* Capability allowing an agent to _request_ info about a content piece in | ||
* Filecoin deals. | ||
*/ | ||
export const filecoinInfo = capability({ | ||
can: 'filecoin/info', | ||
/** | ||
* DID of the space the content is stored in. | ||
*/ | ||
with: Schema.did(), | ||
nb: Schema.struct({ | ||
/** | ||
* CID of the piece. | ||
* | ||
* @see https://github.com/filecoin-project/FIPs/pull/758/files | ||
*/ | ||
piece: PieceLink, | ||
}), | ||
derives: (claim, from) => { | ||
return ( | ||
and(equalWith(claim, from)) || | ||
and(checkLink(claim.nb.piece, from.nb.piece, 'nb.piece')) || | ||
ok({}) | ||
) | ||
}, | ||
}) |
@@ -76,2 +76,3 @@ import * as Provider from './provider.js' | ||
Storefront.filecoinAccept.can, | ||
Storefront.filecoinInfo.can, | ||
Aggregator.pieceOffer.can, | ||
@@ -78,0 +79,0 @@ Aggregator.pieceAccept.can, |
@@ -308,2 +308,17 @@ import type { TupleToUnion } from 'type-fest' | ||
export interface FilecoinInfoSuccess { | ||
piece: PieceLink | ||
deals: FilecoinInfoAcceptedDeal[] | ||
} | ||
export interface FilecoinInfoAcceptedDeal | ||
extends DataAggregationProof, | ||
DealDetails { | ||
aggregate: PieceLink | ||
} | ||
export type FilecoinInfoFailure = | ||
| ContentNotFound | ||
| InvalidContentPiece | ||
| Ucanto.Failure | ||
// filecoin aggregator | ||
@@ -553,2 +568,5 @@ export interface PieceOfferSuccess { | ||
> | ||
export type FilecoinInfo = InferInvokedCapability< | ||
typeof StorefrontCaps.filecoinInfo | ||
> | ||
export type PieceOffer = InferInvokedCapability< | ||
@@ -615,2 +633,3 @@ typeof AggregatorCaps.pieceOffer | ||
FilecoinAccept['can'], | ||
FilecoinInfo['can'], | ||
PieceOffer['can'], | ||
@@ -617,0 +636,0 @@ PieceAccept['can'], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
146527
3392