diff --git a/packages/w3up-client/package.json b/packages/w3up-client/package.json index 9ac874927..aea4ebb04 100644 --- a/packages/w3up-client/package.json +++ b/packages/w3up-client/package.json @@ -119,6 +119,7 @@ "scripts": { "attw": "attw --pack .", "lint": "tsc --build && eslint '**/*.{js,ts}' && prettier --check '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore", + "lint:fix": "tsc --build && eslint '**/*.{js,ts}' --fix && prettier --write '**/*.{js,ts,yml,json}' --ignore-path ../../.gitignore", "build": "tsc --build", "dev": "tsc --build --watch", "check": "tsc --build", diff --git a/packages/w3up-client/src/client.js b/packages/w3up-client/src/client.js index 94960b00e..1385fc8bb 100644 --- a/packages/w3up-client/src/client.js +++ b/packages/w3up-client/src/client.js @@ -255,6 +255,8 @@ export class Client extends Base { * In addition, it authorizes the listed Gateway Services to serve content from the created space. * It is done by delegating the `space/content/serve/*` capability to the Gateway Service. * User can skip the Gateway authorization by setting the `skipGatewayAuthorization` option to `true`. + * If no gateways are specified or the `skipGatewayAuthorization` flag is not set, the client will automatically grant access + * to the Storacha Gateway by default (https://freewaying.dag.haus/). * * @typedef {import('./types.js').ConnectionView} ConnectionView * @@ -311,10 +313,10 @@ export class Client extends Base { UcantoClient.connect({ id: { did: () => - /** @type {`did:${string}:${string}`} */( - /* c8 ignore next - default prod gateway id is not used in tests */ - process.env.DEFAULT_GATEWAY_ID ?? 'did:web:w3s.link' - ), + /** @type {`did:${string}:${string}`} */ ( + /* c8 ignore next - default prod gateway id is not used in tests */ + process.env.DEFAULT_GATEWAY_ID ?? 'did:web:w3s.link' + ), }, codec: CAR.outbound, channel: HTTP.open({ @@ -611,7 +613,9 @@ export const authorizeContentServe = async ( /* c8 ignore next 8 - can't mock this error */ if (verificationResult.out.error) { throw new Error( - `failed to publish delegation for audience ${audience.did()}: ${verificationResult.out.error.message}`, + `failed to publish delegation for audience ${audience.did()}: ${ + verificationResult.out.error.message + }`, { cause: verificationResult.out.error, }