Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@web3-storage/capabilities

Package Overview
Dependencies
Maintainers
5
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@web3-storage/capabilities - npm Package Compare versions

Comparing version 9.2.0 to 9.2.1

38

dist/src/filecoin.d.ts
/**
* `filecoin/add` capability allows agent to add a filecoin piece to be aggregated
* `filecoin/queue` capability allows agent to queue a filecoin piece to be aggregated
* so that it can be stored by a Storage provider on a future time.
*/
export const filecoinQueue: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"filecoin/queue", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{
protocol: "did:";
}>, Schema.InferStruct<{
content: Schema.Schema<import("@ucanto/interface").Link<unknown, number, number, 0 | 1>, any>;
piece: import("./types").PieceLinkSchema;
}>>>;
/**
* `filecoin/add` capability allows storefront to add a filecoin piece to be aggregated
* so that it can be stored by a Storage provider on a future time.
*/
export const filecoinAdd: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"filecoin/add", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{

@@ -12,5 +22,15 @@ protocol: "did:";

/**
* `aggregate/add` capability allows agent to add a piece to be aggregated
* `aggregate/queue` capability allows storefront to queue a piece to be aggregated
* so that it can be stored by a Storage provider on a future time.
*/
export const aggregateQueue: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"aggregate/queue", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{
protocol: "did:";
}>, Schema.InferStruct<{
piece: import("./types").PieceLinkSchema;
group: Schema.StringSchema<string, unknown>;
}>>>;
/**
* `aggregate/add` capability allows aggregator to add a piece to aggregate
* so that it can be stored by a Storage provider on a future time.
*/
export const aggregateAdd: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"aggregate/add", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{

@@ -24,5 +44,17 @@ protocol: "did:";

/**
* `deal/add` capability allows agent to create a deal offer to get an aggregate
* `deal/queue` capability allows storefront to create a deal offer to get an aggregate
* of CARs files in the market to be fetched and stored by a Storage provider.
*/
export const dealQueue: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"deal/queue", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{
protocol: "did:";
}>, Schema.InferStruct<{
pieces: Schema.Schema<import("@ucanto/interface").Link<unknown, number, number, 0 | 1>, any>;
aggregate: import("./types").PieceLinkSchema;
storefront: Schema.StringSchema<string, unknown>;
label: Schema.Schema<string | undefined, unknown>;
}>>>;
/**
* `deal/add` capability allows Dealer to submit offer with an aggregate of
* Filecoin pieces in the market to be fetched and stored by a Storage provider.
*/
export const dealAdd: import("@ucanto/interface").TheCapabilityParser<import("@ucanto/interface").CapabilityMatch<"deal/add", `did:${string}:${string}` & `did:${string}` & import("@ucanto/interface").Phantom<{

@@ -29,0 +61,0 @@ protocol: "did:";

@@ -161,4 +161,7 @@ import type { TupleToUnion } from 'type-fest';

export type StoreList = InferInvokedCapability<typeof list>;
export type FilecoinQueue = InferInvokedCapability<typeof FilecoinCaps.filecoinQueue>;
export type FilecoinAdd = InferInvokedCapability<typeof FilecoinCaps.filecoinAdd>;
export type AggregateQueue = InferInvokedCapability<typeof FilecoinCaps.aggregateQueue>;
export type AggregateAdd = InferInvokedCapability<typeof FilecoinCaps.aggregateAdd>;
export type DealQueue = InferInvokedCapability<typeof FilecoinCaps.dealQueue>;
export type DealAdd = InferInvokedCapability<typeof FilecoinCaps.dealAdd>;

@@ -191,4 +194,7 @@ export type ChainTrackerInfo = InferInvokedCapability<typeof FilecoinCaps.chainTrackerInfo>;

RateLimitList['can'],
FilecoinQueue['can'],
FilecoinAdd['can'],
AggregateQueue['can'],
AggregateAdd['can'],
DealQueue['can'],
DealAdd['can'],

@@ -195,0 +201,0 @@ ChainTrackerInfo['can']

2

package.json
{
"name": "@web3-storage/capabilities",
"version": "9.2.0",
"version": "9.2.1",
"description": "Capabilities provided by web3.storage",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/web3-storage/w3protocol/tree/main/packages/capabilities",

@@ -33,5 +33,35 @@ /**

/**
* `filecoin/add` capability allows agent to add a filecoin piece to be aggregated
* `filecoin/queue` capability allows agent to queue a filecoin piece to be aggregated
* so that it can be stored by a Storage provider on a future time.
*/
export const filecoinQueue = capability({
can: 'filecoin/queue',
/**
* did:key identifier of the broker authority where offer is made available.
*/
with: Schema.did(),
nb: Schema.struct({
/**
* CID of the content that resulted in Filecoin piece.
*/
content: Schema.link(),
/**
* CID of the piece.
*/
piece: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
}),
derives: (claim, from) => {
return (
and(equalWith(claim, from)) ||
and(checkLink(claim.nb.content, from.nb.content, 'nb.content')) ||
and(checkLink(claim.nb.piece, from.nb.piece, 'nb.piece')) ||
ok({})
)
},
})
/**
* `filecoin/add` capability allows storefront to add a filecoin piece to be aggregated
* so that it can be stored by a Storage provider on a future time.
*/
export const filecoinAdd = capability({

@@ -66,5 +96,35 @@ can: 'filecoin/add',

/**
* `aggregate/add` capability allows agent to add a piece to be aggregated
* `aggregate/queue` capability allows storefront to queue a piece to be aggregated
* so that it can be stored by a Storage provider on a future time.
*/
export const aggregateQueue = capability({
can: 'aggregate/queue',
/**
* did:key identifier of the broker authority where offer is made available.
*/
with: Schema.did(),
nb: Schema.struct({
/**
* CID of the piece.
*/
piece: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
/**
* Grouping for the piece to be aggregated
*/
group: Schema.text(),
}),
derives: (claim, from) => {
return (
and(equalWith(claim, from)) ||
and(checkLink(claim.nb.piece, from.nb.piece, 'nb.piece')) ||
and(equal(claim.nb.group, from.nb.group, 'nb.group')) ||
ok({})
)
},
})
/**
* `aggregate/add` capability allows aggregator to add a piece to aggregate
* so that it can be stored by a Storage provider on a future time.
*/
export const aggregateAdd = capability({

@@ -84,3 +144,3 @@ can: 'aggregate/add',

/**
* Storefront requestin piece to be aggregated
* Storefront requesting piece to be aggregated
*/

@@ -105,5 +165,47 @@ storefront: Schema.text(),

/**
* `deal/add` capability allows agent to create a deal offer to get an aggregate
* `deal/queue` capability allows storefront to create a deal offer to get an aggregate
* of CARs files in the market to be fetched and stored by a Storage provider.
*/
export const dealQueue = capability({
can: 'deal/queue',
/**
* did:key identifier of the broker authority where offer is made available.
*/
with: Schema.did(),
nb: Schema.struct({
/**
* CID of the DAG-CBOR encoded block with offer details.
* Service will queue given offer to be validated and handled.
*/
pieces: Schema.link(),
/**
* Commitment proof for the aggregate being offered.
* https://github.com/filecoin-project/go-state-types/blob/1e6cf0d47cdda75383ef036fc2725d1cf51dbde8/abi/piece.go#L47-L50
*/
aggregate: /** @type {import('./types').PieceLinkSchema} */ (PIECE_LINK),
/**
* Storefront requesting deal
*/
storefront: Schema.text(),
/**
* arbitrary label to be added to the deal on chain
*/
label: Schema.text().optional(),
}),
derives: (claim, from) => {
return (
and(equalWith(claim, from)) ||
and(checkLink(claim.nb.aggregate, from.nb.aggregate, 'nb.aggregate')) ||
and(checkLink(claim.nb.pieces, from.nb.pieces, 'nb.pieces')) ||
and(equal(claim.nb.storefront, from.nb.storefront, 'nb.storefront')) ||
and(equal(claim.nb.label, from.nb.label, 'nb.label')) ||
ok({})
)
},
})
/**
* `deal/add` capability allows Dealer to submit offer with an aggregate of
* Filecoin pieces in the market to be fetched and stored by a Storage provider.
*/
export const dealAdd = capability({

@@ -110,0 +212,0 @@ can: 'deal/add',

@@ -55,6 +55,9 @@ import * as Provider from './provider.js'

RateLimit.list.can,
Filecoin.filecoinQueue.can,
Filecoin.filecoinAdd.can,
Filecoin.aggregateQueue.can,
Filecoin.aggregateAdd.can,
Filecoin.dealQueue.can,
Filecoin.dealAdd.can,
Filecoin.chainTrackerInfo.can,
]

@@ -215,8 +215,15 @@ import type { TupleToUnion } from 'type-fest'

// Filecoin
export type FilecoinQueue = InferInvokedCapability<
typeof FilecoinCaps.filecoinQueue
>
export type FilecoinAdd = InferInvokedCapability<
typeof FilecoinCaps.filecoinAdd
>
export type AggregateQueue = InferInvokedCapability<
typeof FilecoinCaps.aggregateQueue
>
export type AggregateAdd = InferInvokedCapability<
typeof FilecoinCaps.aggregateAdd
>
export type DealQueue = InferInvokedCapability<typeof FilecoinCaps.dealQueue>
export type DealAdd = InferInvokedCapability<typeof FilecoinCaps.dealAdd>

@@ -254,6 +261,9 @@ export type ChainTrackerInfo = InferInvokedCapability<

RateLimitList['can'],
FilecoinQueue['can'],
FilecoinAdd['can'],
AggregateQueue['can'],
AggregateAdd['can'],
DealQueue['can'],
DealAdd['can'],
ChainTrackerInfo['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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc