import type { RawAxiosRequestHeaders } from 'axios'; import type { GetTeamParams, GetOrganizationParams, QueryParams, CollectionProp, GetSpaceParams } from '../../common-types'; import type { TeamProps, CreateTeamProps } from '../../export-types'; import type { OptionalDefaults } from '../wrappers/wrap'; export type TeamPlainClientAPI = { /** * Fetch a single team by its ID * @param params the team and organization IDs * @returns the requested team * @throws if the request fails, or the team or organization is not found * @example * ```javascript * const team = await client.team.get({ * organizationId: '', * teamId: '' * }) * ``` */ get(params: OptionalDefaults): Promise; /** * Fetch all teams for a given organization * @param params the organization ID and optional pagination query parameters * @returns A collection of teams * @throws if the request fails, or the organization is not found * @example * ```javascript * const teams = await client.team.getMany({ * organizationId: '', * query: { * limit: 10, * } * }) * ``` */ getMany(params: OptionalDefaults): Promise>; /** * Fetch all teams for a given space * @param params the space ID and optional pagination query parameters * @returns A collection of teams * @throws if the request fails, or the space is not found * @example * ```javascript * const teams = await client.team.getManyForSpace({ * spaceId: '', * query: { * limit: 10, * } * }) * ``` */ getManyForSpace(params: OptionalDefaults): Promise>; /** * Create a new team * @param params the organization ID * @param rawData the team name and description * @returns the created team * @throws if the request fails, or the organization is not found * @example * ```javascript * const team = await client.team.create({ * organizationId: '', * }, { * name: 'My Team', * description: 'A team for my organization', * }) * ``` */ create(params: OptionalDefaults, rawData: CreateTeamProps, headers?: RawAxiosRequestHeaders): Promise; /** * Update a team * @param params the organization and team IDs * @param rawData the team data * @returns the updated team * @throws if the request fails, or the organization or team are not found * @example * ```javascript * let team = await client.team.get({ * organizationId: '', * teamId: '' * }) * * team = await client.team.update({ * organizationId: '', * teamId: '' * }, { * ...team, * name: 'New team name', * }) * ``` */ update(params: OptionalDefaults, rawData: TeamProps, headers?: RawAxiosRequestHeaders): Promise; /** * Delete a team * @param params the organization and team IDs * @throws if the request fails, or the organization or team are not found * @example * ```javascript * await client.team.delete({ * organizationId: '', * teamId: '' * }) * ``` */ delete(params: OptionalDefaults): Promise; };