refactor(core): simplify location filesystem (#31545)
This commit is contained in:
@@ -266,6 +266,8 @@ import type {
|
||||
V2CommandListResponses,
|
||||
V2EventSubscribeErrors,
|
||||
V2EventSubscribeResponses,
|
||||
V2FsFindErrors,
|
||||
V2FsFindResponses,
|
||||
V2FsListErrors,
|
||||
V2FsListResponses,
|
||||
V2FsReadErrors,
|
||||
@@ -5601,6 +5603,43 @@ export class Fs extends HeyApiClient {
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Find files
|
||||
*
|
||||
* Find recursively ranked filesystem entries relative to the requested location.
|
||||
*/
|
||||
public find<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
location?: {
|
||||
directory?: string
|
||||
workspace?: string
|
||||
}
|
||||
query: string
|
||||
type?: "file" | "directory"
|
||||
limit?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "location" },
|
||||
{ in: "query", key: "query" },
|
||||
{ in: "query", key: "type" },
|
||||
{ in: "query", key: "limit" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).get<V2FsFindResponses, V2FsFindErrors, ThrowOnError>({
|
||||
url: "/api/fs/find",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Command2 extends HeyApiClient {
|
||||
|
||||
Reference in New Issue
Block a user