mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(builder): client side api implementation
This commit is contained in:
@@ -8,6 +8,8 @@ import {
|
||||
GraphExecuteResponse,
|
||||
NodeExecutionResult,
|
||||
User,
|
||||
UserData,
|
||||
TutorialStepData,
|
||||
} from "./types";
|
||||
|
||||
export default class AutoGPTServerAPI {
|
||||
@@ -32,6 +34,15 @@ export default class AutoGPTServerAPI {
|
||||
return this._request("POST", "/auth/user", {});
|
||||
}
|
||||
|
||||
// Analytics
|
||||
async logCreateUser(userData: UserData): Promise<string> {
|
||||
return this._request("POST", "/analytics/log_new_user", userData);
|
||||
}
|
||||
|
||||
async logTutorialStep(data: TutorialStepData): Promise<string> {
|
||||
return this._request("POST", "/analytics/log_tutorial_step", data);
|
||||
}
|
||||
|
||||
async getBlocks(): Promise<Block[]> {
|
||||
return await this._get("/blocks");
|
||||
}
|
||||
|
||||
@@ -182,3 +182,15 @@ export type User = {
|
||||
id: string;
|
||||
email: string;
|
||||
};
|
||||
|
||||
export type UserData = {
|
||||
user_id: string;
|
||||
email: string;
|
||||
name: string;
|
||||
username: string;
|
||||
};
|
||||
|
||||
export type TutorialStepData = {
|
||||
step: number;
|
||||
data: { [key: string]: any };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user