@ucanto/core
Advanced tools
Comparing version 2.0.0 to 3.0.0
@@ -1,2 +0,2 @@ | ||
export function isLink(value: API.Proof): value is UCAN.Link<UCAN.Capabilities, number>; | ||
export function isLink(value: API.Proof): value is UCAN.Link<UCAN.Capabilities, UCAN.Code, number>; | ||
export function isDelegation(proof: API.Proof): proof is API.Delegation<UCAN.Capabilities>; | ||
@@ -17,8 +17,8 @@ /** | ||
constructor(root: API.UCANBlock<C>, blocks?: Map<string, API.Transport.Block<any, number, number, 1>> | undefined); | ||
root: UCAN.Block<C, number>; | ||
root: UCAN.Block<C, UCAN.Code, number>; | ||
blocks: Map<string, API.Transport.Block<any, number, number, 1>>; | ||
get version(): `${number}.${number}.${number}`; | ||
get signature(): UCAN.Signature<string, number>; | ||
get cid(): UCAN.Link<C, number>; | ||
get asCID(): UCAN.Link<C, number>; | ||
get cid(): UCAN.IPLDLink<UCAN.UCAN<C>, UCAN.Code, number, 1>; | ||
get asCID(): UCAN.IPLDLink<UCAN.UCAN<C>, UCAN.Code, number, 1>; | ||
get bytes(): UCAN.ByteView<UCAN.UCAN<C>>; | ||
@@ -69,3 +69,3 @@ get data(): UCAN.View<C>; | ||
export function create<C extends UCAN.Capabilities>({ root, blocks }: { | ||
root: UCAN.Block<C, number>; | ||
root: UCAN.Block<C, UCAN.Code, number>; | ||
blocks?: Map<string, API.Transport.Block<unknown, number, number, 1>> | undefined; | ||
@@ -81,4 +81,4 @@ }): API.Delegation<C>; | ||
*/ | ||
declare function exportDAG<C extends UCAN.Capabilities>(root: UCAN.Block<C, number>, blocks: Map<string, API.Block>): IterableIterator<API.Block>; | ||
declare function exportDAG<C extends UCAN.Capabilities>(root: UCAN.Block<C, UCAN.Code, number>, blocks: Map<string, API.Block>): IterableIterator<API.Block>; | ||
export { exportDAG as export, _export as export, importDAG as import, _import as import, Delegation as View }; | ||
//# sourceMappingURL=delegation.d.ts.map |
@@ -6,3 +6,3 @@ export * as Delegation from "./delegation.js"; | ||
export { delegate, isDelegation } from "./delegation.js"; | ||
export { create as createLink, createV0 as createLegacyLink, isLink, asLink, parse as parseLink, decode as decodeLink } from "./link.js"; | ||
export { create as createLink, createLegacy as createLegacyLink, isLink, parse as parseLink, decode as decodeLink } from "./link.js"; | ||
//# sourceMappingURL=lib.d.ts.map |
@@ -1,8 +0,2 @@ | ||
export function create<Code extends number, Alg extends number>(code: Code, digest: API.MultihashDigest<Alg>): API.Link<unknown, Code, Alg, 1>; | ||
export function createV0<Alg extends number>(digest: API.MultihashDigest<Alg>): API.Link<unknown, 112, Alg, 0>; | ||
export function isLink<L extends API.Link<any, number, number, 1>>(value: unknown): value is L; | ||
export function asLink<L extends API.Link<unknown, number, number, API.UCAN.CIDVersion>>(value: unknown): L | null; | ||
export function parse<P extends string>(source: string, base?: API.MultibaseDecoder<P> | undefined): API.Link<unknown, number, number, API.UCAN.CIDVersion>; | ||
export function decode(bytes: Uint8Array): API.Link<unknown, number, number, API.UCAN.CIDVersion>; | ||
import * as API from "@ucanto/interface"; | ||
export * from "multiformats/dist/types/src/link"; | ||
//# sourceMappingURL=link.d.ts.map |
{ | ||
"name": "@ucanto/core", | ||
"description": "ucanto core", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"keywords": [ | ||
@@ -24,20 +24,18 @@ "UCAN", | ||
"dependencies": { | ||
"@ipld/car": "^4.1.5", | ||
"@ipld/car": "^4.1.6", | ||
"@ipld/dag-cbor": "^7.0.3", | ||
"@ipld/dag-ucan": "^4.0.0-beta", | ||
"@ucanto/interface": "^2.0.0", | ||
"multiformats": "^9.8.1" | ||
"@ipld/dag-ucan": "^2.0.0", | ||
"@ucanto/interface": "^3.0.0", | ||
"multiformats": "^10.0.0" | ||
}, | ||
"devDependencies": { | ||
"@types/chai": "^4.3.3", | ||
"@types/chai-subset": "^1.3.3", | ||
"@types/mocha": "^9.1.0", | ||
"@ucanto/principal": "^2.0.0", | ||
"@ucanto/principal": "^3.0.0", | ||
"c8": "^7.11.0", | ||
"chai": "^4.3.6", | ||
"chai-subset": "^1.6.0", | ||
"mocha": "^10.0.0", | ||
"mocha": "^10.1.0", | ||
"nyc": "^15.1.0", | ||
"playwright-test": "^8.1.1", | ||
"typescript": "^4.8.3" | ||
"typescript": "^4.8.4" | ||
}, | ||
@@ -87,5 +85,5 @@ "type": "module", | ||
"coverage": "c8 --reporter=html mocha test/*.spec.js && npm_config_yes=true npx st -d coverage -p 8080", | ||
"typecheck": "tsc --build", | ||
"check": "tsc --build", | ||
"build": "tsc --build" | ||
} | ||
} |
@@ -6,5 +6,4 @@ export * as Delegation from './delegation.js' | ||
create as createLink, | ||
createV0 as createLegacyLink, | ||
createLegacy as createLegacyLink, | ||
isLink, | ||
asLink, | ||
parse as parseLink, | ||
@@ -11,0 +10,0 @@ decode as decodeLink, |
@@ -1,41 +0,1 @@ | ||
import { CID } from 'multiformats' | ||
import * as API from '@ucanto/interface' | ||
/** | ||
* @template {number} Code | ||
* @template {number} Alg | ||
* @param {Code} code | ||
* @param {API.MultihashDigest<Alg>} digest | ||
* @return {API.Link<unknown, Code, Alg>} | ||
*/ | ||
export const create = (code, digest) => | ||
/** @type {any} */ (CID.createV1(code, digest)) | ||
/** | ||
* @template {number} Alg | ||
* @param {API.MultihashDigest<Alg>} digest | ||
* @return {API.Link<unknown, 0x70, Alg, 0>} | ||
*/ | ||
export const createV0 = digest => /** @type {any} */ (CID.createV0(digest)) | ||
/** | ||
* Type predicate returns true if value is the link. | ||
* | ||
* @template {API.Link} L | ||
* @param {unknown} value | ||
* @returns {value is L} | ||
*/ | ||
export const isLink = value => | ||
value != null && /** @type {{asCID: unknown}} */ (value).asCID === value | ||
export const asLink = | ||
/** @type {<L extends API.Link<unknown, number, number, API.UCAN.CIDVersion>>(value:L|unknown) => L|null} */ | ||
(CID.asCID) | ||
export const parse = | ||
/** @type {<P extends string>(source:string, base?:API.MultibaseDecoder<P>) => API.Link<unknown, number, number, API.UCAN.CIDVersion>} */ | ||
(CID.parse) | ||
export const decode = | ||
/** @type {(bytes:Uint8Array) => API.Link<unknown, number, number, API.UCAN.CIDVersion>} */ | ||
(CID.decode) | ||
export * from 'multiformats/link' |
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
9
15125
415
+ Added@ipld/dag-cbor@8.0.1(transitive)
+ Added@ipld/dag-json@9.1.1(transitive)
+ Added@ipld/dag-ucan@2.0.1(transitive)
+ Added@ucanto/interface@3.0.1(transitive)
+ Addedmultiformats@10.0.311.0.2(transitive)
- Removed@ipld/dag-json@8.0.11(transitive)
- Removed@ipld/dag-ucan@4.0.0-beta(transitive)
- Removed@ucanto/interface@2.0.0(transitive)
Updated@ipld/car@^4.1.6
Updated@ipld/dag-ucan@^2.0.0
Updated@ucanto/interface@^3.0.0
Updatedmultiformats@^10.0.0