Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5a42c7e

Browse files
committed
api.ts
1 parent855fde9 commit5a42c7e

File tree

1 file changed

+35
-1
lines changed

1 file changed

+35
-1
lines changed

‎site/src/api/api.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,11 @@ export type GetProvisionerDaemonsParams = {
411411
* lexical scope.
412412
*/
413413
classApiMethods{
414-
constructor(protectedreadonlyaxios:AxiosInstance){}
414+
experimental:ExperimentalApiMethods;
415+
416+
constructor(protectedreadonlyaxios:AxiosInstance){
417+
this.experimental=newExperimentalApiMethods(this.axios);
418+
}
415419

416420
login=async(
417421
email:string,
@@ -2599,6 +2603,36 @@ class ApiMethods {
25992603
};
26002604
}
26012605

2606+
// Experimental API methods call endpoints under the /api/experimental/ prefix.
2607+
// These endpoints are not stable and may change or be removed at any time.
2608+
//
2609+
// All methods must be defined with arrow function syntax. See the docstring
2610+
// above the ApiMethods class for a full explanation.
2611+
classExperimentalApiMethods{
2612+
constructor(protectedreadonlyaxios:AxiosInstance){}
2613+
2614+
getAITasksPrompts=async(
2615+
buildIds:TypesGen.WorkspaceBuild["id"][],
2616+
):Promise<TypesGen.AITasksPromptsResponse>=>{
2617+
if(buildIds.length===0){
2618+
return{
2619+
prompts:{},
2620+
};
2621+
}
2622+
2623+
constresponse=awaitthis.axios.get<TypesGen.AITasksPromptsResponse>(
2624+
"/api/experimental/aitasks/prompts",
2625+
{
2626+
params:{
2627+
build_ids:buildIds.join(","),
2628+
},
2629+
},
2630+
);
2631+
2632+
returnresponse.data;
2633+
};
2634+
}
2635+
26022636
// This is a hard coded CSRF token/cookie pair for local development. In prod,
26032637
// the GoLang webserver generates a random cookie with a new token for each
26042638
// document request. For local development, we don't use the Go webserver for

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp