UNPKG

1.26 kBTypeScriptView Raw
1import type { PaginationQueryParams, CollectionProp, GetOrganizationParams } from '../../common-types';
2import type { OrganizationProp } from '../../entities/organization';
3import type { OptionalDefaults } from '../wrappers/wrap';
4export type OrganizationPlainClientAPI = {
5 /**
6 * Fetch all organizations the user has access to
7 * @param params Optional pagination query parameters
8 * @returns A collection of organizations
9 * @throws if the request fails, or no organizations are found
10 * @example
11 * ```javascript
12 * const organizations = await client.organization.getAll({
13 * query: {
14 * limit: 10,
15 * }
16 * })
17 * ```
18 */
19 getAll(params?: OptionalDefaults<PaginationQueryParams>): Promise<CollectionProp<OrganizationProp>>;
20 /**
21 * Fetch a single organization by its ID
22 * @param params the organization ID
23 * @returns the requested organization
24 * @throws if the request fails, or the organization is not found
25 * @example
26 * ```javascript
27 * const organization = await client.organization.get({
28 * organizationId: '<organization_id>'
29 * })
30 * ```
31 */
32 get(params: OptionalDefaults<GetOrganizationParams>): Promise<OrganizationProp>;
33};