FEAT - TASKER CODEX: user-scoped multi-workspace grants
This commit is contained in:
@@ -77,6 +77,31 @@ export type TCodexAgentGrantListResponse = {
|
||||
grants: TCodexAgentGrant[];
|
||||
};
|
||||
|
||||
export type TCodexAgentProjectGrantInput = {
|
||||
project_id: string;
|
||||
workspace_slug: string;
|
||||
};
|
||||
|
||||
export type TCodexAgentGrantableProject = {
|
||||
id: string;
|
||||
workspace_slug: string;
|
||||
name: string;
|
||||
identifier?: string | null;
|
||||
};
|
||||
|
||||
export type TCodexAgentGrantableWorkspace = {
|
||||
id: string;
|
||||
slug: string;
|
||||
name: string;
|
||||
role: number;
|
||||
projects: TCodexAgentGrantableProject[];
|
||||
};
|
||||
|
||||
export type TCodexAgentProjectAccessResponse = {
|
||||
ok: boolean;
|
||||
workspaces: TCodexAgentGrantableWorkspace[];
|
||||
};
|
||||
|
||||
export type TCodexAgentSetupResponse = {
|
||||
ok: boolean;
|
||||
setup?: TCodexAgentSetupPacket;
|
||||
@@ -95,6 +120,14 @@ export class WorkspaceCodexAgentService extends APIService {
|
||||
});
|
||||
}
|
||||
|
||||
async listProjectAccess(workspaceSlug: string): Promise<TCodexAgentProjectAccessResponse> {
|
||||
return this.get(`/api/workspaces/${workspaceSlug}/codex-agent-api/project-access/`)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async createAgent(
|
||||
workspaceSlug: string,
|
||||
data: { display_name: string; avatar_url?: string | null }
|
||||
@@ -158,6 +191,25 @@ export class WorkspaceCodexAgentService extends APIService {
|
||||
});
|
||||
}
|
||||
|
||||
async replaceProjectGrantsAcrossWorkspaces(
|
||||
workspaceSlug: string,
|
||||
agentId: string,
|
||||
data: {
|
||||
grants: TCodexAgentProjectGrantInput[];
|
||||
mode?: TCodexAgentGrantMode;
|
||||
scopes: string[];
|
||||
}
|
||||
): Promise<TCodexAgentGrantListResponse> {
|
||||
return this.post(
|
||||
`/api/workspaces/${workspaceSlug}/codex-agent-api/agents/${agentId}/grants/replace-projects/`,
|
||||
data
|
||||
)
|
||||
.then((response) => response?.data)
|
||||
.catch((error) => {
|
||||
throw error?.response?.data;
|
||||
});
|
||||
}
|
||||
|
||||
async createToken(
|
||||
workspaceSlug: string,
|
||||
agentId: string,
|
||||
|
||||
Reference in New Issue
Block a user