Spaces:
Runtime error
Runtime error
Download next/src/services/api/org.ts from dia-gov/AgentGPT-Web-GUI: direct link, hf CLI and curl.
- Browser
- Download file 629 Bytes
-
https://huggingface.co/spaces/dia-gov/AgentGPT-Web-GUI/resolve/main/next/src/services/api/org.ts
- Command line
-
hf download hf://spaces/dia-gov/AgentGPT-Web-GUI/next/src/services/api/org.ts
-
curl -L -o org.ts https://huggingface.co/spaces/dia-gov/AgentGPT-Web-GUI/resolve/main/next/src/services/api/org.ts
629 Bytes
| import { z } from "zod"; | |
| import { get } from "../fetch-utils"; | |
| const OrganizationUsersSchema = z.object({ | |
| id: z.string(), | |
| name: z.string(), | |
| users: z.array( | |
| z.object({ | |
| id: z.string(), | |
| role: z.string(), | |
| user: z.object({ | |
| id: z.string(), | |
| name: z.string(), | |
| email: z.string(), | |
| }), | |
| }) | |
| ), | |
| }); | |
| export class OrganizationApi { | |
| readonly accessToken?: string; | |
| constructor(accessToken?: string) { | |
| this.accessToken = accessToken; | |
| } | |
| async get(name: string) { | |
| return await get(`/api/auth/organization/${name}`, OrganizationUsersSchema, this.accessToken); | |
| } | |
| } | |