From 2c684ea5c4e04e049303e3489b6f6836e5153031 Mon Sep 17 00:00:00 2001 From: Benjamin Goering <171782+gobengo@users.noreply.github.com> Date: Wed, 30 Nov 2022 13:48:29 -0800 Subject: [PATCH] chore: split packages/access-client/src/capabilities to new package @web3-storage/capabilities (#218) Motivation: * https://github.com/web3-storage/w3protocol/issues/80 To do: * [x] initial package split * [x] remove capabilities dir from packages/access-client and fix imports in access-client * [x] fix imports from other packages that were importing from access-client/capabilities * [x] consider splitting to `capabilities/{service}/types` not `capabilities/types` * decided not to unless requested (makes exports map even more complicated, can do later) * [x] GH actions should run tests on packages/capabilities * [x] .github/workflows/release.yml does npm/docs jobs if paths_released contains packages/capabilities Co-authored-by: Irakli Gozalishvili --- .github/release-please-config.json | 1 + .github/workflows/access-client.yml | 2 +- .github/workflows/capabilities.yml | 44 ++++++++ .github/workflows/release.yml | 10 +- .github/workflows/upload-client.yml | 2 +- packages/access-api/package.json | 1 + packages/access-api/src/kvs/spaces.js | 6 +- packages/access-api/src/service/index.js | 5 +- .../access-api/src/service/voucher-claim.js | 2 +- .../access-api/src/service/voucher-redeem.js | 2 +- packages/access-api/src/utils/html.js | 2 +- .../access-api/test/account-recover.test.js | 10 +- packages/access-api/test/helpers/utils.js | 7 +- .../access-api/test/voucher-claim.test.js | 2 +- .../access-api/test/voucher-redeem.test.js | 7 +- packages/access-api/tsconfig.json | 2 +- packages/access-client/package.json | 1 + packages/access-client/src/agent.js | 7 +- packages/access-client/src/delegations.js | 2 +- packages/access-client/src/index.js | 7 +- packages/access-client/src/types.ts | 7 +- packages/access-client/test/agent.test.js | 2 +- .../access-client/test/capabilities.test.js | 7 -- packages/access-client/test/helpers/utils.js | 2 +- .../stores/store-indexeddb.browser.test.js | 2 +- packages/access-client/tsconfig.json | 3 +- packages/capabilities/package.json | 102 ++++++++++++++++++ packages/capabilities/readme.md | 15 +++ .../src/capabilities/space.js | 2 + .../src/capabilities/store.js | 0 .../src/capabilities/top.js | 0 .../src/capabilities/types.ts | 0 .../src/capabilities/upload.js | 0 .../src/capabilities/utils.js | 0 .../src/capabilities/voucher.js | 2 + packages/capabilities/src/index.js | 5 + .../test/capabilities/store.test.js | 0 .../test/capabilities/upload.test.js | 0 .../test/capabilities/voucher.test.js | 0 .../capabilities/test/helpers/fixtures.js | 18 ++++ packages/capabilities/test/helpers/utils.js | 29 +++++ packages/capabilities/tsconfig.json | 10 ++ packages/upload-client/package.json | 1 + packages/upload-client/src/store.js | 2 +- packages/upload-client/src/types.ts | 2 +- packages/upload-client/src/upload.js | 2 +- packages/upload-client/test/index.test.js | 4 +- packages/upload-client/test/sharding.test.js | 2 +- packages/upload-client/test/store.test.js | 2 +- packages/upload-client/test/upload.test.js | 2 +- packages/upload-client/tsconfig.json | 2 +- pnpm-lock.yaml | 65 +++++++++-- tsconfig.json | 6 +- 53 files changed, 346 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/capabilities.yml delete mode 100644 packages/access-client/test/capabilities.test.js create mode 100644 packages/capabilities/package.json create mode 100644 packages/capabilities/readme.md rename packages/{access-client => capabilities}/src/capabilities/space.js (98%) rename packages/{access-client => capabilities}/src/capabilities/store.js (100%) rename packages/{access-client => capabilities}/src/capabilities/top.js (100%) rename packages/{access-client => capabilities}/src/capabilities/types.ts (100%) rename packages/{access-client => capabilities}/src/capabilities/upload.js (100%) rename packages/{access-client => capabilities}/src/capabilities/utils.js (100%) rename packages/{access-client => capabilities}/src/capabilities/voucher.js (99%) create mode 100644 packages/capabilities/src/index.js rename packages/{access-client => capabilities}/test/capabilities/store.test.js (100%) rename packages/{access-client => capabilities}/test/capabilities/upload.test.js (100%) rename packages/{access-client => capabilities}/test/capabilities/voucher.test.js (100%) create mode 100644 packages/capabilities/test/helpers/fixtures.js create mode 100644 packages/capabilities/test/helpers/utils.js create mode 100644 packages/capabilities/tsconfig.json diff --git a/.github/release-please-config.json b/.github/release-please-config.json index fb70ca333..6e523b9b6 100644 --- a/.github/release-please-config.json +++ b/.github/release-please-config.json @@ -3,6 +3,7 @@ "packages": { "packages/access-client": {}, "packages/access-api": {}, + "packages/capabilities": {}, "packages/upload-client": {}, "packages/wallet": {} } diff --git a/.github/workflows/access-client.yml b/.github/workflows/access-client.yml index bcf4808e9..c2ee4847e 100644 --- a/.github/workflows/access-client.yml +++ b/.github/workflows/access-client.yml @@ -28,7 +28,7 @@ jobs: node-version: 18 cache: 'pnpm' - run: pnpm install - - run: pnpm run build + - run: pnpm -r --filter @web3-storage/access run build - run: pnpm -r --filter @web3-storage/access run lint - run: pnpm -r --filter @web3-storage/access run test - run: pnpm --filter @web3-storage/access -r exec depcheck diff --git a/.github/workflows/capabilities.yml b/.github/workflows/capabilities.yml new file mode 100644 index 000000000..81109b075 --- /dev/null +++ b/.github/workflows/capabilities.yml @@ -0,0 +1,44 @@ +name: '@web3-storage/capabilities' +env: + CI: true + FORCE_COLOR: 1 +on: + push: + branches: + - main + paths: + - 'packages/capabilities/**' + - '.github/workflows/capabilities.yml' + - 'pnpm-lock.yaml' + pull_request: + paths: + - 'packages/capabilities/**' + - '.github/workflows/capabilities.yml' + - 'pnpm-lock.yaml' +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + pnpm-version: + - 7 + node-version: + - 18 + package: + - capabilities + steps: + - uses: actions/checkout@v3 + - uses: pnpm/action-setup@v2.2.3 + with: + version: ${{ matrix.pnpm-version }} + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + - run: pnpm install + - name: Typecheck + uses: gozala/typescript-error-reporter-action@v1.0.8 + with: + project: packages/${{matrix.package}}/tsconfig.json + - run: pnpm -r --filter @web3-storage/${{matrix.package}} run lint + - run: pnpm -r --filter @web3-storage/${{matrix.package}} run test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a48a761a7..6bacfde15 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,10 @@ jobs: secrets: inherit npm: needs: release - if: contains(fromJson(needs.release.outputs.paths_released), 'packages/access-client') || contains(fromJson(needs.release.outputs.paths_released), 'packages/upload-client') + if: | + contains(fromJson(needs.release.outputs.paths_released), 'packages/access-client') || + contains(fromJson(needs.release.outputs.paths_released), 'packages/capabilities') || + contains(fromJson(needs.release.outputs.paths_released), 'packages/upload-client') runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -56,5 +59,8 @@ jobs: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} docs: needs: release - if: contains(fromJson(needs.release.outputs.paths_released), 'packages/access-client') || contains(fromJson(needs.release.outputs.paths_released), 'packages/upload-client') + if: | + contains(fromJson(needs.release.outputs.paths_released), 'packages/access-client') || + contains(fromJson(needs.release.outputs.paths_released), 'packages/capabilities') || + contains(fromJson(needs.release.outputs.paths_released), 'packages/upload-client') uses: './.github/workflows/reusable-deploy-docs.yml' diff --git a/.github/workflows/upload-client.yml b/.github/workflows/upload-client.yml index 8eb4dc4f8..6e144836b 100644 --- a/.github/workflows/upload-client.yml +++ b/.github/workflows/upload-client.yml @@ -28,7 +28,7 @@ jobs: node-version: 18 cache: 'pnpm' - run: pnpm install - - run: pnpm run build + - run: pnpm -r --filter @web3-storage/upload-client run build - run: pnpm -r --filter @web3-storage/upload-client run lint - run: pnpm -r --filter @web3-storage/upload-client run test - run: pnpm --filter @web3-storage/access-api -r exec depcheck diff --git a/packages/access-api/package.json b/packages/access-api/package.json index 3dbbabe4e..d2e683454 100644 --- a/packages/access-api/package.json +++ b/packages/access-api/package.json @@ -23,6 +23,7 @@ "@ucanto/server": "^3.0.4", "@ucanto/transport": "^3.0.2", "@web3-storage/access": "workspace:^", + "@web3-storage/capabilities": "workspace:^", "@web3-storage/worker-utils": "0.4.3-dev", "p-retry": "^5.1.2", "preact": "^10.11.3", diff --git a/packages/access-api/src/kvs/spaces.js b/packages/access-api/src/kvs/spaces.js index 386ef43db..c54fdfc5a 100644 --- a/packages/access-api/src/kvs/spaces.js +++ b/packages/access-api/src/kvs/spaces.js @@ -22,8 +22,8 @@ export class Spaces { } /** - * @param {import('@web3-storage/access/capabilities/types').VoucherRedeem} capability - * @param {Ucanto.Invocation} invocation + * @param {import('@web3-storage/capabilities/types').VoucherRedeem} capability + * @param {Ucanto.Invocation} invocation */ async create(capability, invocation) { await this.db.insert({ @@ -110,7 +110,7 @@ export class Spaces { return } - return /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/access/types').Top]>[]} */ ( + return /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/capabilities/types').Top]>[]} */ ( r ) } diff --git a/packages/access-api/src/service/index.js b/packages/access-api/src/service/index.js index 94ee126e8..93474f634 100644 --- a/packages/access-api/src/service/index.js +++ b/packages/access-api/src/service/index.js @@ -1,6 +1,6 @@ import * as Server from '@ucanto/server' import { Failure } from '@ucanto/server' -import * as Space from '@web3-storage/access/capabilities/space' +import * as Space from '@web3-storage/capabilities/space' import { voucherClaimProvider } from './voucher-claim.js' import { voucherRedeemProvider } from './voucher-redeem.js' import * as DID from '@ipld/dag-ucan/did' @@ -8,7 +8,6 @@ import { delegationToString, stringToDelegation, } from '@web3-storage/access/encoding' -import { top } from '@web3-storage/access/capabilities/top' /** * @param {import('../bindings').RouteContext} ctx @@ -52,7 +51,7 @@ export function service(ctx) { const results = [] for (const e of encoded) { const proof = await stringToDelegation(e) - const del = await top.delegate({ + const del = await Space.top.delegate({ audience: invocation.issuer, issuer: ctx.signer, with: proof.capabilities[0].with, diff --git a/packages/access-api/src/service/voucher-claim.js b/packages/access-api/src/service/voucher-claim.js index 8a210512b..1937a8971 100644 --- a/packages/access-api/src/service/voucher-claim.js +++ b/packages/access-api/src/service/voucher-claim.js @@ -1,5 +1,5 @@ import * as Server from '@ucanto/server' -import * as Voucher from '@web3-storage/access/capabilities/voucher' +import * as Voucher from '@web3-storage/capabilities/voucher' import { delegationToString } from '@web3-storage/access/encoding' /** diff --git a/packages/access-api/src/service/voucher-redeem.js b/packages/access-api/src/service/voucher-redeem.js index ae1fdc332..20d6a098d 100644 --- a/packages/access-api/src/service/voucher-redeem.js +++ b/packages/access-api/src/service/voucher-redeem.js @@ -1,5 +1,5 @@ import * as Server from '@ucanto/server' -import * as Voucher from '@web3-storage/access/capabilities/voucher' +import * as Voucher from '@web3-storage/capabilities/voucher' import { Delegation } from '@ucanto/core' import { Failure } from '@ucanto/server' /** diff --git a/packages/access-api/src/utils/html.js b/packages/access-api/src/utils/html.js index 083987196..66b7ff9d3 100644 --- a/packages/access-api/src/utils/html.js +++ b/packages/access-api/src/utils/html.js @@ -72,7 +72,7 @@ export class HtmlResponse extends Response { /** * * @param {object} param0 - * @param {Ucanto.Delegation<[import('@web3-storage/access/capabilities/types').VoucherClaim]> | Ucanto.Delegation<[import('@web3-storage/access/capabilities/types').SpaceRecover]>} param0.delegation + * @param {Ucanto.Delegation<[import('@web3-storage/capabilities/types').VoucherClaim]> | Ucanto.Delegation<[import('@web3-storage/capabilities/types').SpaceRecover]>} param0.delegation * @param {string} param0.ucan * @param {string} param0.qrcode */ diff --git a/packages/access-api/test/account-recover.test.js b/packages/access-api/test/account-recover.test.js index 4c25a5d54..7145c09f1 100644 --- a/packages/access-api/test/account-recover.test.js +++ b/packages/access-api/test/account-recover.test.js @@ -1,4 +1,4 @@ -import * as Space from '@web3-storage/access/capabilities/space' +import * as Space from '@web3-storage/capabilities/space' import { stringToDelegation } from '@web3-storage/access/encoding' import pWaitFor from 'p-wait-for' import { context, test } from './helpers/context.js' @@ -53,7 +53,7 @@ test('should return space/recover', async (t) => { const url = new URL(inv) const encoded = - /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/access/capabilities/types').SpaceRecover]>} */ ( + /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/capabilities/types').SpaceRecover]>} */ ( url.searchParams.get('ucan') ) @@ -70,7 +70,7 @@ test('should return space/recover', async (t) => { // @ts-ignore const validations = new Validations(await mf.getKVNamespace('VALIDATIONS')) const recoverEncoded = - /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/access/capabilities/types').SpaceRecover]>} */ ( + /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/capabilities/types').SpaceRecover]>} */ ( await validations.get(issuer.did()) ) @@ -94,7 +94,7 @@ test('should return space/recover', async (t) => { const data = JSON.parse(event.data) const encoded = - /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/access/capabilities/types').SpaceRecover]>} */ ( + /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/capabilities/types').SpaceRecover]>} */ ( data.delegation ) @@ -141,7 +141,7 @@ test('should invoke space/recover and get space delegation', async (t) => { const url = new URL(inv) const encoded = - /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/access/capabilities/types').SpaceRecover]>} */ ( + /** @type {import('@web3-storage/access/types').EncodedDelegation<[import('@web3-storage/capabilities/types').SpaceRecover]>} */ ( url.searchParams.get('ucan') ) diff --git a/packages/access-api/test/helpers/utils.js b/packages/access-api/test/helpers/utils.js index 7299d6c49..e0926c13b 100644 --- a/packages/access-api/test/helpers/utils.js +++ b/packages/access-api/test/helpers/utils.js @@ -2,8 +2,7 @@ import * as UCAN from '@ipld/dag-ucan' // eslint-disable-next-line no-unused-vars import * as Types from '@ucanto/interface' -import * as Top from '@web3-storage/access/capabilities/top' -import * as Voucher from '@web3-storage/access/capabilities/voucher' +import * as Voucher from '@web3-storage/capabilities/voucher' import { stringToDelegation } from '@web3-storage/access/encoding' import { Signer } from '@ucanto/principal/ed25519' @@ -40,7 +39,7 @@ export async function createSpace(issuer, service, conn, email) { service: service.did(), }, proofs: [ - await Top.top.delegate({ + await Voucher.top.delegate({ issuer: space, audience: issuer, with: space.did(), @@ -67,7 +66,7 @@ export async function createSpace(issuer, service, conn, email) { }, proofs: [ delegation, - await Top.top.delegate({ + await Voucher.top.delegate({ issuer: space, audience: service, with: space.did(), diff --git a/packages/access-api/test/voucher-claim.test.js b/packages/access-api/test/voucher-claim.test.js index 738779aca..1458924fa 100644 --- a/packages/access-api/test/voucher-claim.test.js +++ b/packages/access-api/test/voucher-claim.test.js @@ -1,5 +1,5 @@ import { Delegation } from '@ucanto/core' -import * as Voucher from '@web3-storage/access/capabilities/voucher' +import * as Voucher from '@web3-storage/capabilities/voucher' import { stringToDelegation } from '@web3-storage/access/encoding' import { context, test } from './helpers/context.js' diff --git a/packages/access-api/test/voucher-redeem.test.js b/packages/access-api/test/voucher-redeem.test.js index 636fb811c..381accbd4 100644 --- a/packages/access-api/test/voucher-redeem.test.js +++ b/packages/access-api/test/voucher-redeem.test.js @@ -1,6 +1,5 @@ /* eslint-disable unicorn/prefer-number-properties */ -import * as Top from '@web3-storage/access/capabilities/top' -import * as Voucher from '@web3-storage/access/capabilities/voucher' +import * as Voucher from '@web3-storage/capabilities/voucher' import { stringToDelegation } from '@web3-storage/access/encoding' import { context, test } from './helpers/context.js' import { createSpace } from './helpers/utils.js' @@ -26,7 +25,7 @@ test('should return voucher/redeem', async (t) => { service: service.did(), }, proofs: [ - await Top.top.delegate({ + await Voucher.top.delegate({ issuer: space, audience: issuer, with: space.did(), @@ -57,7 +56,7 @@ test('should return voucher/redeem', async (t) => { }, proofs: [ delegation, - await Top.top.delegate({ + await Voucher.top.delegate({ issuer: space, audience: service, with: space.did(), diff --git a/packages/access-api/tsconfig.json b/packages/access-api/tsconfig.json index 76ae2f9cf..8f439d4e1 100644 --- a/packages/access-api/tsconfig.json +++ b/packages/access-api/tsconfig.json @@ -8,5 +8,5 @@ }, "include": ["src", "scripts", "test", "package.json", "sql"], "exclude": ["**/node_modules/**"], - "references": [{ "path": "../access-client" }] + "references": [{ "path": "../access-client" }, { "path": "../capabilities" }] } diff --git a/packages/access-client/package.json b/packages/access-client/package.json index bb2b38872..b707dc99f 100644 --- a/packages/access-client/package.json +++ b/packages/access-client/package.json @@ -66,6 +66,7 @@ "@ucanto/principal": "^3.0.1", "@ucanto/transport": "^3.0.2", "@ucanto/validator": "^3.0.4", + "@web3-storage/capabilities": "workspace:^", "bigint-mod-arith": "^3.1.2", "conf": "^10.2.0", "inquirer": "^9.1.4", diff --git a/packages/access-client/src/agent.js b/packages/access-client/src/agent.js index 49a137ef2..8baadc89a 100644 --- a/packages/access-client/src/agent.js +++ b/packages/access-client/src/agent.js @@ -9,9 +9,8 @@ import * as CBOR from '@ucanto/transport/cbor' import * as HTTP from '@ucanto/transport/http' import { URI } from '@ucanto/validator' import { Peer } from './awake/peer.js' -import * as Space from './capabilities/space.js' -import * as Voucher from './capabilities/voucher.js' -import { top as Top } from './capabilities/top.js' +import * as Space from '@web3-storage/capabilities/space' +import * as Voucher from '@web3-storage/capabilities/voucher' import { stringToDelegation } from './encoding.js' import { Websocket, AbortError } from './utils/ws.js' import { Signer } from '@ucanto/principal/ed25519' @@ -225,7 +224,7 @@ export class Agent { */ async createSpace(name) { const signer = await Signer.generate() - const proof = await Top.delegate({ + const proof = await Space.top.delegate({ issuer: signer, audience: this.issuer, with: signer.did(), diff --git a/packages/access-client/src/delegations.js b/packages/access-client/src/delegations.js index 551d5cc63..5844701f3 100644 --- a/packages/access-client/src/delegations.js +++ b/packages/access-client/src/delegations.js @@ -1,7 +1,7 @@ // @ts-ignore // eslint-disable-next-line no-unused-vars import * as Ucanto from '@ucanto/interface' -import { canDelegateAbility } from './capabilities/utils.js' +import { canDelegateAbility } from '@web3-storage/capabilities/utils' /** * diff --git a/packages/access-client/src/index.js b/packages/access-client/src/index.js index 99fb59e81..b75ef2270 100644 --- a/packages/access-client/src/index.js +++ b/packages/access-client/src/index.js @@ -1,12 +1,9 @@ /* eslint-disable jsdoc/check-tag-names */ export * from './agent.js' +export { Space, Store, Top, Upload, Voucher } from '@web3-storage/capabilities' + // Workaround for typedoc until 0.24 support export maps -export * as Space from './capabilities/space.js' -export * as Top from './capabilities/top.js' -export * as Store from './capabilities/store.js' -export * as Upload from './capabilities/upload.js' -export * as Voucher from './capabilities/voucher.js' export * as Encoding from './encoding.js' export { StoreConf } from './stores/store-conf.js' export { StoreIndexedDB } from './stores/store-indexeddb.js' diff --git a/packages/access-client/src/types.ts b/packages/access-client/src/types.ts index e0438dcbd..f3477d8ec 100644 --- a/packages/access-client/src/types.ts +++ b/packages/access-client/src/types.ts @@ -27,14 +27,15 @@ import type { SpaceInfo, SpaceRecover, SpaceRecoverValidation, + VoucherClaim, + VoucherRedeem, Top, -} from './capabilities/types' -import { VoucherClaim, VoucherRedeem } from './capabilities/types.js' +} from '@web3-storage/capabilities/types' import { IStore } from './stores/types.js' import type { SetRequired } from 'type-fest' // export other types -export * from './capabilities/types.js' +export * from '@web3-storage/capabilities/types' export * from './stores/types.js' /** diff --git a/packages/access-client/test/agent.test.js b/packages/access-client/test/agent.test.js index ebfacdc78..304eeca8e 100644 --- a/packages/access-client/test/agent.test.js +++ b/packages/access-client/test/agent.test.js @@ -2,7 +2,7 @@ import assert from 'assert' import { URI } from '@ucanto/validator' import { Agent } from '../src/agent.js' import { StoreMemory } from '../src/stores/store-memory.js' -import * as Space from '../src/capabilities/space.js' +import * as Space from '@web3-storage/capabilities/space' import { createServer } from './helpers/utils.js' import * as fixtures from './helpers/fixtures.js' diff --git a/packages/access-client/test/capabilities.test.js b/packages/access-client/test/capabilities.test.js deleted file mode 100644 index 316424a00..000000000 --- a/packages/access-client/test/capabilities.test.js +++ /dev/null @@ -1,7 +0,0 @@ -import assert from 'assert' - -describe('capabilities', function () { - it('should sign', function () { - assert.ok(true) - }) -}) diff --git a/packages/access-client/test/helpers/utils.js b/packages/access-client/test/helpers/utils.js index d861d44a1..579f0de4e 100644 --- a/packages/access-client/test/helpers/utils.js +++ b/packages/access-client/test/helpers/utils.js @@ -2,7 +2,7 @@ import * as Ucanto from '@ucanto/interface' import { parseLink } from '@ucanto/core' import * as Server from '@ucanto/server' -import * as Space from '../../src/capabilities/space.js' +import * as Space from '@web3-storage/capabilities/space' import * as CAR from '@ucanto/transport/car' import * as CBOR from '@ucanto/transport/cbor' import { service } from './fixtures.js' diff --git a/packages/access-client/test/stores/store-indexeddb.browser.test.js b/packages/access-client/test/stores/store-indexeddb.browser.test.js index 7d87c7835..b1f15df78 100644 --- a/packages/access-client/test/stores/store-indexeddb.browser.test.js +++ b/packages/access-client/test/stores/store-indexeddb.browser.test.js @@ -1,5 +1,5 @@ import assert from 'assert' -import { top } from '../../src/capabilities/top.js' +import { top } from '@web3-storage/capabilities/top' import { StoreIndexedDB } from '../../src/stores/store-indexeddb.js' import { Signer } from '@ucanto/principal/ed25519' diff --git a/packages/access-client/tsconfig.json b/packages/access-client/tsconfig.json index 180297270..8f9db5b03 100644 --- a/packages/access-client/tsconfig.json +++ b/packages/access-client/tsconfig.json @@ -6,5 +6,6 @@ "emitDeclarationOnly": true }, "include": ["src", "scripts", "test", "package.json"], - "exclude": ["**/node_modules/**"] + "exclude": ["**/node_modules/**"], + "references": [{ "path": "../capabilities" }] } diff --git a/packages/capabilities/package.json b/packages/capabilities/package.json new file mode 100644 index 000000000..2b5e9873c --- /dev/null +++ b/packages/capabilities/package.json @@ -0,0 +1,102 @@ +{ + "name": "@web3-storage/capabilities", + "version": "0.0.0", + "description": "Capabilities provided by web3.storage", + "homepage": "https://github.com/web3-storage/w3protocol/tree/main/packages/capabilities", + "repository": { + "type": "git", + "url": "https://github.com/web3-storage/w3protocol.git", + "directory": "packages/capabilities" + }, + "license": "(Apache-2.0 OR MIT)", + "type": "module", + "types": "dist/src/index.d.ts", + "main": "src/index.js", + "scripts": { + "lint": "tsc && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore", + "build": "tsc --build", + "test": "pnpm -r --filter @web3-storage/capabilities run build && npm run test:node && npm run test:browser", + "test:node": "mocha 'test/**/!(*.browser).test.js' -n experimental-vm-modules -n no-warnings", + "test:browser": "playwright-test 'test/**/!(*.node).test.js'", + "testw": "watch 'pnpm test' src test --interval 1", + "rc": "npm version prerelease --preid rc" + }, + "exports": { + ".": "./src/index.js", + "./types": "./dist/src/capabilities/types.d.ts", + "./*": "./src/capabilities/*.js" + }, + "typesVersions": { + "*": { + "space": [ + "dist/src/capabilities/space" + ], + "store": [ + "dist/src/capabilities/store" + ], + "types": [ + "dist/src/capabilities/types" + ], + "top": [ + "dist/src/capabilities/top" + ], + "upload": [ + "dist/src/capabilities/upload" + ], + "utils": [ + "dist/src/capabilities/utils" + ], + "voucher": [ + "dist/src/capabilities/voucher" + ] + } + }, + "files": [ + "src", + "dist/src/**/*.d.ts", + "dist/src/**/*.d.ts.map" + ], + "dependencies": { + "@ipld/car": "^5.0.1", + "@ipld/dag-ucan": "^2.0.1", + "@ucanto/client": "^3.0.2", + "@ucanto/core": "^3.0.2", + "@ucanto/interface": "^3.0.1", + "@ucanto/principal": "^3.0.1", + "@ucanto/server": "^3.0.4", + "@ucanto/transport": "^3.0.2", + "@ucanto/validator": "^3.0.4" + }, + "devDependencies": { + "@types/assert": "^1.5.6", + "@types/mocha": "^10.0.0", + "@types/node": "^18.11.9", + "@web-std/fetch": "^4.1.0", + "assert": "^2.0.0", + "hd-scripts": "^3.0.2", + "mocha": "^10.1.0", + "playwright-test": "^8.1.1", + "typescript": "4.8.4", + "watch": "^1.0.2" + }, + "eslintConfig": { + "extends": [ + "./node_modules/hd-scripts/eslint/preact.js" + ], + "parserOptions": { + "project": "./tsconfig.json" + }, + "rules": { + "unicorn/prefer-number-properties": "off", + "unicorn/prefer-export-from": "off", + "unicorn/no-array-reduce": "off" + }, + "env": { + "mocha": true + }, + "ignorePatterns": [ + "dist", + "coverage" + ] + } +} diff --git a/packages/capabilities/readme.md b/packages/capabilities/readme.md new file mode 100644 index 000000000..45a5e9b45 --- /dev/null +++ b/packages/capabilities/readme.md @@ -0,0 +1,15 @@ +# ⁂ `@web3-storage/capabilities` + +[Capabilities](https://en.wikipedia.org/wiki/Capability-based_security) for interacting with [web3.storage](https://web3.storage) + +## Install + +Install the package: + +```bash +npm install @web3-storage/capabilities +``` + +## Usage + +[API Reference](https://web3-storage.github.io/w3protocol/modules/_web3_storage_capabilities.html) diff --git a/packages/access-client/src/capabilities/space.js b/packages/capabilities/src/capabilities/space.js similarity index 98% rename from packages/access-client/src/capabilities/space.js rename to packages/capabilities/src/capabilities/space.js index f45237367..9ef28502b 100644 --- a/packages/access-client/src/capabilities/space.js +++ b/packages/capabilities/src/capabilities/space.js @@ -14,6 +14,8 @@ import { store } from './store.js' import { capability, URI } from '@ucanto/validator' import { canDelegateURI, equalWith, fail } from './utils.js' +export { top } from './top.js' + export const space = top.derive({ to: capability({ can: 'space/*', diff --git a/packages/access-client/src/capabilities/store.js b/packages/capabilities/src/capabilities/store.js similarity index 100% rename from packages/access-client/src/capabilities/store.js rename to packages/capabilities/src/capabilities/store.js diff --git a/packages/access-client/src/capabilities/top.js b/packages/capabilities/src/capabilities/top.js similarity index 100% rename from packages/access-client/src/capabilities/top.js rename to packages/capabilities/src/capabilities/top.js diff --git a/packages/access-client/src/capabilities/types.ts b/packages/capabilities/src/capabilities/types.ts similarity index 100% rename from packages/access-client/src/capabilities/types.ts rename to packages/capabilities/src/capabilities/types.ts diff --git a/packages/access-client/src/capabilities/upload.js b/packages/capabilities/src/capabilities/upload.js similarity index 100% rename from packages/access-client/src/capabilities/upload.js rename to packages/capabilities/src/capabilities/upload.js diff --git a/packages/access-client/src/capabilities/utils.js b/packages/capabilities/src/capabilities/utils.js similarity index 100% rename from packages/access-client/src/capabilities/utils.js rename to packages/capabilities/src/capabilities/utils.js diff --git a/packages/access-client/src/capabilities/voucher.js b/packages/capabilities/src/capabilities/voucher.js similarity index 99% rename from packages/access-client/src/capabilities/voucher.js rename to packages/capabilities/src/capabilities/voucher.js index 786ae9cf2..99127f2f1 100644 --- a/packages/access-client/src/capabilities/voucher.js +++ b/packages/capabilities/src/capabilities/voucher.js @@ -15,6 +15,8 @@ import * as Types from '@ucanto/interface' import { equalWith, fail, equal } from './utils.js' import { top } from './top.js' +export { top } + /** * Products are identified by the CID of the DAG that describes them. */ diff --git a/packages/capabilities/src/index.js b/packages/capabilities/src/index.js new file mode 100644 index 000000000..48ca39915 --- /dev/null +++ b/packages/capabilities/src/index.js @@ -0,0 +1,5 @@ +export * as Space from './capabilities/space.js' +export * as Top from './capabilities/top.js' +export * as Store from './capabilities/store.js' +export * as Upload from './capabilities/upload.js' +export * as Voucher from './capabilities/voucher.js' diff --git a/packages/access-client/test/capabilities/store.test.js b/packages/capabilities/test/capabilities/store.test.js similarity index 100% rename from packages/access-client/test/capabilities/store.test.js rename to packages/capabilities/test/capabilities/store.test.js diff --git a/packages/access-client/test/capabilities/upload.test.js b/packages/capabilities/test/capabilities/upload.test.js similarity index 100% rename from packages/access-client/test/capabilities/upload.test.js rename to packages/capabilities/test/capabilities/upload.test.js diff --git a/packages/access-client/test/capabilities/voucher.test.js b/packages/capabilities/test/capabilities/voucher.test.js similarity index 100% rename from packages/access-client/test/capabilities/voucher.test.js rename to packages/capabilities/test/capabilities/voucher.test.js diff --git a/packages/capabilities/test/helpers/fixtures.js b/packages/capabilities/test/helpers/fixtures.js new file mode 100644 index 000000000..5f03c4314 --- /dev/null +++ b/packages/capabilities/test/helpers/fixtures.js @@ -0,0 +1,18 @@ +import { Signer } from '@ucanto/principal/ed25519' + +/** did:key:z6Mkqa4oY9Z5Pf5tUcjLHLUsDjKwMC95HGXdE1j22jkbhz6r */ +export const alice = Signer.parse( + 'MgCZT5vOnYZoVAeyjnzuJIVY9J4LNtJ+f8Js0cTPuKUpFne0BVEDJjEu6quFIU8yp91/TY/+MYK8GvlKoTDnqOCovCVM=' +) +/** did:key:z6MkffDZCkCTWreg8868fG1FGFogcJj5X6PY93pPcWDn9bob */ +export const bob = Signer.parse( + 'MgCYbj5AJfVvdrjkjNCxB3iAUwx7RQHVQ7H1sKyHy46Iose0BEevXgL1V73PD9snOCIoONgb+yQ9sycYchQC8kygR4qY=' +) +/** did:key:z6MktafZTREjJkvV5mfJxcLpNBoVPwDLhTuMg9ng7dY4zMAL */ +export const mallory = Signer.parse( + 'MgCYtH0AvYxiQwBG6+ZXcwlXywq9tI50G2mCAUJbwrrahkO0B0elFYkl3Ulf3Q3A/EvcVY0utb4etiSE8e6pi4H0FEmU=' +) + +export const service = Signer.parse( + 'MgCYKXoHVy7Vk4/QjcEGi+MCqjntUiasxXJ8uJKY0qh11e+0Bs8WsdqGK7xothgrDzzWD0ME7ynPjz2okXDh8537lId8=' +) diff --git a/packages/capabilities/test/helpers/utils.js b/packages/capabilities/test/helpers/utils.js new file mode 100644 index 000000000..2df7b772a --- /dev/null +++ b/packages/capabilities/test/helpers/utils.js @@ -0,0 +1,29 @@ +// eslint-disable-next-line no-unused-vars +import * as Ucanto from '@ucanto/interface' +import { parseLink } from '@ucanto/core' +import * as CAR from '@ucanto/transport/car' +import * as CBOR from '@ucanto/transport/cbor' + +/** + * @param {string} source + */ +export function parseCarLink(source) { + return /** @type {Ucanto.Link} */ (parseLink(source)) +} + +/** + * @param {any} data + */ +export async function createCborCid(data) { + const cbor = await CBOR.codec.write(data) + return cbor.cid +} + +/** + * @param {string} source + */ +export async function createCarCid(source) { + const cbor = await CBOR.codec.write({ hello: source }) + const shard = await CAR.codec.write({ roots: [cbor] }) + return shard.cid +} diff --git a/packages/capabilities/tsconfig.json b/packages/capabilities/tsconfig.json new file mode 100644 index 000000000..180297270 --- /dev/null +++ b/packages/capabilities/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist", + "lib": ["ESNext", "DOM"], + "emitDeclarationOnly": true + }, + "include": ["src", "scripts", "test", "package.json"], + "exclude": ["**/node_modules/**"] +} diff --git a/packages/upload-client/package.json b/packages/upload-client/package.json index ce03e1546..816f3ddb1 100644 --- a/packages/upload-client/package.json +++ b/packages/upload-client/package.json @@ -70,6 +70,7 @@ "@ucanto/interface": "^3.0.0", "@ucanto/transport": "^3.0.1", "@web3-storage/access": "workspace:^", + "@web3-storage/capabilities": "workspace:^", "multiformats": "^10.0.2", "p-queue": "^7.3.0", "p-retry": "^5.1.2" diff --git a/packages/upload-client/src/store.js b/packages/upload-client/src/store.js index f6729b72b..d8361d83e 100644 --- a/packages/upload-client/src/store.js +++ b/packages/upload-client/src/store.js @@ -1,5 +1,5 @@ import { CAR } from '@ucanto/transport' -import * as StoreCapabilities from '@web3-storage/access/capabilities/store' +import * as StoreCapabilities from '@web3-storage/capabilities/store' import retry, { AbortError } from 'p-retry' import { servicePrincipal, connection } from './service.js' import { REQUEST_RETRIES } from './constants.js' diff --git a/packages/upload-client/src/types.ts b/packages/upload-client/src/types.ts index 54600a40f..2ae6bc9f3 100644 --- a/packages/upload-client/src/types.ts +++ b/packages/upload-client/src/types.ts @@ -16,7 +16,7 @@ import { UploadAdd, UploadList, UploadRemove, -} from '@web3-storage/access/capabilities/types' +} from '@web3-storage/capabilities/types' export type { StoreAdd, diff --git a/packages/upload-client/src/upload.js b/packages/upload-client/src/upload.js index af03d9fb5..4555af574 100644 --- a/packages/upload-client/src/upload.js +++ b/packages/upload-client/src/upload.js @@ -1,4 +1,4 @@ -import * as UploadCapabilities from '@web3-storage/access/capabilities/upload' +import * as UploadCapabilities from '@web3-storage/capabilities/upload' import retry from 'p-retry' import { servicePrincipal, connection } from './service.js' import { REQUEST_RETRIES } from './constants.js' diff --git a/packages/upload-client/test/index.test.js b/packages/upload-client/test/index.test.js index d82f01cbd..80122137d 100644 --- a/packages/upload-client/test/index.test.js +++ b/packages/upload-client/test/index.test.js @@ -5,8 +5,8 @@ import { provide } from '@ucanto/server' import * as CAR from '@ucanto/transport/car' import * as CBOR from '@ucanto/transport/cbor' import * as Signer from '@ucanto/principal/ed25519' -import * as StoreCapabilities from '@web3-storage/access/capabilities/store' -import * as UploadCapabilities from '@web3-storage/access/capabilities/upload' +import * as StoreCapabilities from '@web3-storage/capabilities/store' +import * as UploadCapabilities from '@web3-storage/capabilities/upload' import { uploadFile, uploadDirectory } from '../src/index.js' import { serviceSigner } from './fixtures.js' import { randomBytes } from './helpers/random.js' diff --git a/packages/upload-client/test/sharding.test.js b/packages/upload-client/test/sharding.test.js index ccc4d1761..00bc012b8 100644 --- a/packages/upload-client/test/sharding.test.js +++ b/packages/upload-client/test/sharding.test.js @@ -5,7 +5,7 @@ import { provide } from '@ucanto/server' import * as CAR from '@ucanto/transport/car' import * as CBOR from '@ucanto/transport/cbor' import * as Signer from '@ucanto/principal/ed25519' -import * as StoreCapabilities from '@web3-storage/access/capabilities/store' +import * as StoreCapabilities from '@web3-storage/capabilities/store' import { createFileEncoderStream } from '../src/unixfs.js' import { ShardingStream, ShardStoringStream } from '../src/sharding.js' import { serviceSigner } from './fixtures.js' diff --git a/packages/upload-client/test/store.test.js b/packages/upload-client/test/store.test.js index b8eb190d5..8a97e3450 100644 --- a/packages/upload-client/test/store.test.js +++ b/packages/upload-client/test/store.test.js @@ -5,7 +5,7 @@ import { provide } from '@ucanto/server' import * as CAR from '@ucanto/transport/car' import * as CBOR from '@ucanto/transport/cbor' import * as Signer from '@ucanto/principal/ed25519' -import * as StoreCapabilities from '@web3-storage/access/capabilities/store' +import * as StoreCapabilities from '@web3-storage/capabilities/store' import * as Store from '../src/store.js' import { serviceSigner } from './fixtures.js' import { randomCAR } from './helpers/random.js' diff --git a/packages/upload-client/test/upload.test.js b/packages/upload-client/test/upload.test.js index 7d52fabd4..724b08878 100644 --- a/packages/upload-client/test/upload.test.js +++ b/packages/upload-client/test/upload.test.js @@ -5,7 +5,7 @@ import { provide } from '@ucanto/server' import * as CAR from '@ucanto/transport/car' import * as CBOR from '@ucanto/transport/cbor' import * as Signer from '@ucanto/principal/ed25519' -import * as UploadCapabilities from '@web3-storage/access/capabilities/upload' +import * as UploadCapabilities from '@web3-storage/capabilities/upload' import * as Upload from '../src/upload.js' import { serviceSigner } from './fixtures.js' import { randomCAR } from './helpers/random.js' diff --git a/packages/upload-client/tsconfig.json b/packages/upload-client/tsconfig.json index 7c17abaf4..19939a363 100644 --- a/packages/upload-client/tsconfig.json +++ b/packages/upload-client/tsconfig.json @@ -7,5 +7,5 @@ }, "include": ["src", "scripts", "test", "package.json"], "exclude": ["**/node_modules/**"], - "references": [{ "path": "../access-client" }] + "references": [{ "path": "../access-client" }, { "path": "../capabilities" }] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c69af2884..0919ef8e7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,6 +40,7 @@ importers: '@ucanto/server': ^3.0.4 '@ucanto/transport': ^3.0.2 '@web3-storage/access': workspace:^ + '@web3-storage/capabilities': workspace:^ '@web3-storage/worker-utils': 0.4.3-dev ava: ^5.1.0 better-sqlite3: 8.0.0 @@ -69,6 +70,7 @@ importers: '@ucanto/server': 3.0.5 '@ucanto/transport': 3.0.2 '@web3-storage/access': link:../access-client + '@web3-storage/capabilities': link:../capabilities '@web3-storage/worker-utils': 0.4.3-dev p-retry: 5.1.2 preact: 10.11.3 @@ -116,6 +118,7 @@ importers: '@ucanto/server': ^3.0.4 '@ucanto/transport': ^3.0.2 '@ucanto/validator': ^3.0.4 + '@web3-storage/capabilities': workspace:^ assert: ^2.0.0 bigint-mod-arith: ^3.1.2 conf: ^10.2.0 @@ -148,6 +151,7 @@ importers: '@ucanto/principal': 3.0.1 '@ucanto/transport': 3.0.2 '@ucanto/validator': 3.0.4 + '@web3-storage/capabilities': link:../capabilities bigint-mod-arith: 3.1.2 conf: 10.2.0 inquirer: 9.1.4 @@ -222,6 +226,49 @@ importers: typescript: 4.9.3 wrangler: 2.5.0 + packages/capabilities: + specifiers: + '@ipld/car': ^5.0.1 + '@ipld/dag-ucan': ^2.0.1 + '@types/assert': ^1.5.6 + '@types/mocha': ^10.0.0 + '@types/node': ^18.11.9 + '@ucanto/client': ^3.0.2 + '@ucanto/core': ^3.0.2 + '@ucanto/interface': ^3.0.1 + '@ucanto/principal': ^3.0.1 + '@ucanto/server': ^3.0.4 + '@ucanto/transport': ^3.0.2 + '@ucanto/validator': ^3.0.4 + '@web-std/fetch': ^4.1.0 + assert: ^2.0.0 + hd-scripts: ^3.0.2 + mocha: ^10.1.0 + playwright-test: ^8.1.1 + typescript: 4.8.4 + watch: ^1.0.2 + dependencies: + '@ipld/car': 5.0.1 + '@ipld/dag-ucan': 2.0.1 + '@ucanto/client': 3.0.2 + '@ucanto/core': 3.0.2 + '@ucanto/interface': 3.0.1 + '@ucanto/principal': 3.0.1 + '@ucanto/server': 3.0.5 + '@ucanto/transport': 3.0.2 + '@ucanto/validator': 3.0.4 + devDependencies: + '@types/assert': 1.5.6 + '@types/mocha': 10.0.1 + '@types/node': 18.11.9 + '@web-std/fetch': 4.1.0 + assert: 2.0.0 + hd-scripts: 3.0.2 + mocha: 10.1.0 + playwright-test: 8.1.1 + typescript: 4.8.4 + watch: 1.0.2 + packages/upload-client: specifiers: '@ipld/car': ^5.0.0 @@ -235,6 +282,7 @@ importers: '@ucanto/server': ^3.0.1 '@ucanto/transport': ^3.0.1 '@web3-storage/access': workspace:^ + '@web3-storage/capabilities': workspace:^ assert: ^2.0.0 blockstore-core: ^2.0.2 c8: ^7.12.0 @@ -256,6 +304,7 @@ importers: '@ucanto/interface': 3.0.1 '@ucanto/transport': 3.0.2 '@web3-storage/access': link:../access-client + '@web3-storage/capabilities': link:../capabilities multiformats: 10.0.2 p-queue: 7.3.0 p-retry: 5.1.2 @@ -1693,7 +1742,6 @@ packages: dependencies: '@web-std/stream': 1.0.0 web-encoding: 1.1.5 - dev: false /@web-std/fetch/4.1.0: resolution: {integrity: sha512-ZRizMcP8YyuRlhIsRYNFD9x/w28K7kbUhNGmKM9hDy4qeQ5xMTk//wA89EF+Clbl6EP4ksmCcN+4TqBMSRL8Zw==} @@ -1705,29 +1753,24 @@ packages: '@web3-storage/multipart-parser': 1.0.0 data-uri-to-buffer: 3.0.1 mrmime: 1.0.1 - dev: false /@web-std/form-data/3.0.2: resolution: {integrity: sha512-rhc8IRw66sJ0FHcnC84kT3mTN6eACTuNftkt1XSl1Ef6WRKq4Pz65xixxqZymAZl1K3USpwhLci4SKNn4PYxWQ==} dependencies: web-encoding: 1.1.5 - dev: false /@web-std/stream/1.0.0: resolution: {integrity: sha512-jyIbdVl+0ZJyKGTV0Ohb9E6UnxP+t7ZzX4Do3AHjZKxUXKMs9EmqnBDQgHF7bEw0EzbQygOjtt/7gvtmi//iCQ==} dependencies: web-streams-polyfill: 3.2.1 - dev: false /@web-std/stream/1.0.1: resolution: {integrity: sha512-tsz4Y0WNDgFA5jwLSeV7/UV5rfMIlj0cPsSLVfTihjaVW0OJPd5NxJ3le1B3yLyqqzRpeG5OAfJAADLc4VoGTA==} dependencies: web-streams-polyfill: 3.2.1 - dev: false /@web3-storage/multipart-parser/1.0.0: resolution: {integrity: sha512-BEO6al7BYqcnfX15W2cnGR+Q566ACXAT9UQykORCWW80lmkpWsnEob6zJS1ZVBKsSJC8+7vJkHwlp+lXG1UCdw==} - dev: false /@web3-storage/worker-utils/0.4.3-dev: resolution: {integrity: sha512-PJ30KkwtyNoTkVEQjrNhNYQw3JdDRd23GnVfega114m2TIge33qBfD2/X2+Pn1uC4WKpOHKnCmR6tXHmRLgYig==} @@ -1740,7 +1783,6 @@ packages: /@zxing/text-encoding/0.9.0: resolution: {integrity: sha512-U/4aVJ2mxI0aDNI8Uq0wEhMgY+u4CNtEb0om3+y3+niDAsoTCOB33UF0sxpzqzdqXLqmvc+vZyAt4O8pPdfkwA==} requiresBuild: true - dev: false optional: true /abort-controller/3.0.0: @@ -2600,7 +2642,6 @@ packages: /data-uri-to-buffer/3.0.1: resolution: {integrity: sha512-WboRycPNsVw3B3TL559F7kuBUM4d8CgMEvk6xEJlOp7OBPjt6G7z8WMWlD2rOFZLk6OYfFIUGsCOWzcQH9K2og==} engines: {node: '>= 6'} - dev: false /date-time/3.1.0: resolution: {integrity: sha512-uqCUKXE5q1PNBXjPqvwhwJf9SwMoAHBgWJ6DcrnS5o+W2JOiIILl0JEdVD8SGujrNS02GGxgwAg2PN2zONgtjg==} @@ -7548,6 +7589,12 @@ packages: typescript: 4.9.3 dev: false + /typescript/4.8.4: + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /typescript/4.9.3: resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} engines: {node: '>=4.2.0'} @@ -7655,12 +7702,10 @@ packages: util: 0.12.5 optionalDependencies: '@zxing/text-encoding': 0.9.0 - dev: false /web-streams-polyfill/3.2.1: resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} engines: {node: '>= 8'} - dev: false /webidl-conversions/3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} diff --git a/tsconfig.json b/tsconfig.json index f56941d30..1e1be7206 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -35,7 +35,11 @@ }, "typedocOptions": { "entryPointStrategy": "packages", - "entryPoints": ["packages/access-client", "packages/upload-client"], + "entryPoints": [ + "packages/access-client", + "packages/capabilities", + "packages/upload-client" + ], "excludeExternals": true, "darkHighlightTheme": "github-dark", "navigationLinks": {