kubo-rpc-client
Version:
A client library for the Kubo RPC API
18 lines (16 loc) • 471 B
text/typescript
import { encodeQuery } from './utils.js'
import type { PinRemoteAPI } from './index.js'
import type { HTTPRPCClient } from '../../lib/core.js'
export function createRmAll (client: HTTPRPCClient): PinRemoteAPI['rmAll'] {
return async function rmAll ({ timeout, signal, headers, ...query }) {
await client.post('pin/remote/rm', {
timeout,
signal,
headers,
searchParams: encodeQuery({
...query,
all: true
})
})
}
}