Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: type error in access client types #940

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/access-client/src/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ export class Agent {
* @template {Ucanto.URI} R
* @template {Ucanto.Caveats} C
* @param {Ucanto.TheCapabilityParser<Ucanto.CapabilityMatch<A, R, C>>} cap
* @param {import('./types').InvokeOptions<A, R, Ucanto.TheCapabilityParser<Ucanto.CapabilityMatch<A, R, C>>>} options
* @param {import('./types').InvokeOptions<A, Ucanto.TheCapabilityParser<Ucanto.CapabilityMatch<A, R, C>>>} options
* @returns {Promise<Ucanto.InferReceipt<Ucanto.Capability<A, R, C>, S>>}
*/
async invokeAndExecute(cap, options) {
Expand Down Expand Up @@ -520,7 +520,7 @@ export class Agent {
* @template {Ucanto.TheCapabilityParser<Ucanto.CapabilityMatch<A, R, C>>} CAP
* @template {Ucanto.Caveats} [C={}]
* @param {CAP} cap
* @param {import('./types').InvokeOptions<A, R, CAP>} options
* @param {import('./types').InvokeOptions<A, CAP>} options
*/
async invoke(cap, options) {
const space = options.with || this.currentSpace()
Expand Down
5 changes: 2 additions & 3 deletions packages/access-client/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,17 +206,16 @@ export interface AgentDataOptions {

export type InvokeOptions<
A extends Ability,
R extends Resource,
CAP extends CapabilityParser<
Match<{ can: A; with: R; nb: Caveats }, UnknownMatch>
Match<{ can: A; with: Resource; nb: Caveats }, UnknownMatch>
>
> = UCANBasicOptions &
InferNb<InferInvokedCapability<CAP>['nb']> & {
/**
* Resource for the capability, normally a Space DID
* Defaults to the current selected Space
*/
with?: R
with?: Resource

/**
* Extra proofs to be added to the invocation
Expand Down
Loading