diff --git a/packages/w3up-client/package.json b/packages/w3up-client/package.json index 41e1a21ec..f53f5b90e 100644 --- a/packages/w3up-client/package.json +++ b/packages/w3up-client/package.json @@ -28,6 +28,18 @@ "node": "./src/index.node.js", "import": "./src/index.js" }, + "./account": { + "types": "./dist/src/account.d.ts", + "import": "./src/account.js" + }, + "./space": { + "types": "./dist/src/space.d.ts", + "import": "./src/space.js" + }, + "./result": { + "types": "./dist/src/result.d.ts", + "import": "./src/result.js" + }, "./client": { "types": "./dist/src/client.d.ts", "import": "./src/client.js" diff --git a/packages/w3up-client/src/index.js b/packages/w3up-client/src/index.js index 9b5d4f85b..ebfdecf31 100644 --- a/packages/w3up-client/src/index.js +++ b/packages/w3up-client/src/index.js @@ -9,6 +9,8 @@ import { AgentData } from '@web3-storage/access/agent' import { StoreIndexedDB } from '@web3-storage/access/stores/store-indexeddb' import { generate } from '@ucanto/principal/rsa' import { Client } from './client.js' +export * as Result from './result.js' +export * as Account from './account.js' /** * Create a new w3up client. diff --git a/packages/w3up-client/src/index.node.js b/packages/w3up-client/src/index.node.js index 2778d4b16..604b65247 100644 --- a/packages/w3up-client/src/index.node.js +++ b/packages/w3up-client/src/index.node.js @@ -6,6 +6,8 @@ import { AgentData } from '@web3-storage/access/agent' import { StoreConf } from '@web3-storage/access/stores/store-conf' import { generate } from '@ucanto/principal/ed25519' import { Client } from './client.js' +export * as Result from './result.js' +export * as Account from './account.js' /** * Create a new w3up client. diff --git a/packages/w3up-client/src/space.js b/packages/w3up-client/src/space.js index 7593ccfaa..18163297c 100644 --- a/packages/w3up-client/src/space.js +++ b/packages/w3up-client/src/space.js @@ -19,8 +19,9 @@ export class Space { /** * The given space name. */ - name() { - return this.#meta.name + get name() { + /* c8 ignore next */ + return String(this.#meta.name ?? '') } /** diff --git a/packages/w3up-client/test/client.test.js b/packages/w3up-client/test/client.test.js index c010a6550..6574049bd 100644 --- a/packages/w3up-client/test/client.test.js +++ b/packages/w3up-client/test/client.test.js @@ -293,7 +293,7 @@ describe('Client', () => { const spaces = alice.spaces() assert.equal(spaces.length, 1) assert.equal(spaces[0].did(), space.did()) - assert.equal(spaces[0].name(), name) + assert.equal(spaces[0].name, name) }) it('should add space', async () => { diff --git a/packages/w3up-client/test/space.test.js b/packages/w3up-client/test/space.test.js index cda210904..e858e3745 100644 --- a/packages/w3up-client/test/space.test.js +++ b/packages/w3up-client/test/space.test.js @@ -9,7 +9,7 @@ describe('spaces', () => { const isRegistered = true const space = new Space(signer.did(), { name, isRegistered }) assert.equal(space.did(), signer.did()) - assert.equal(space.name(), name) + assert.equal(space.name, name) assert.equal(space.registered(), isRegistered) assert.equal(space.meta().name, name) })