feat: add Ops AI Workspace npm setup command
This commit is contained in:
@@ -139,6 +139,21 @@ export type TAIWorkspaceBridgeEventsResponse = {
|
||||
events: TAIWorkspaceBridgeEvent[];
|
||||
};
|
||||
|
||||
export type TAIWorkspaceAgentSetupCommandResponse = {
|
||||
ok: boolean;
|
||||
executorId?: string;
|
||||
install?: {
|
||||
command?: string;
|
||||
packageName?: string;
|
||||
gatewayUrl?: string;
|
||||
expiresAt?: string;
|
||||
};
|
||||
setupCode?: {
|
||||
suffix?: string;
|
||||
expiresAt?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type TAIWorkspaceOpsProject = {
|
||||
id: string;
|
||||
identifier?: string | null;
|
||||
@@ -284,6 +299,22 @@ export class WorkspaceAIWorkspaceService extends APIService {
|
||||
return this.listExecutors(workspaceSlug);
|
||||
}
|
||||
|
||||
async createAgentSetupCommand(
|
||||
workspaceSlug: string,
|
||||
executorId: string,
|
||||
options: { port?: string | number; opsWorkspaceSlug?: string; opsProjectId?: string } = {}
|
||||
): Promise<TAIWorkspaceAgentSetupCommandResponse> {
|
||||
return this.post(`/api/workspaces/${workspaceSlug}/ai-workspace/executors/${executorId}/agent/setup-command/`, {
|
||||
port: String(options.port || "").trim() || undefined,
|
||||
opsWorkspaceSlug: String(options.opsWorkspaceSlug || "").trim() || undefined,
|
||||
opsProjectId: String(options.opsProjectId || "").trim() || undefined,
|
||||
})
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data ?? error;
|
||||
});
|
||||
}
|
||||
|
||||
getWindowsAgentInstallerUrl(
|
||||
workspaceSlug: string,
|
||||
executorId: string,
|
||||
|
||||
Reference in New Issue
Block a user