import type { UserRole } from "../authentication"; export interface User { user_id: number; access_token: WhoamiAccessTokenInfo; name: string; email: string; role: UserRole; company_access_list: number[]; accessible_companies: CompanyScope[]; current_company_scope: CompanyScope; permissions: WhoamiPermission[]; created_at: string; created_by: null | string; last_updated_at: string | null; last_updated_by: null | string; } /** Metadata about the bearer token used to make the `/whoami` request. */ export interface WhoamiAccessTokenInfo { expires_at: string; } export interface CompanyScope { company_id: number; slug: null | string; name: string; short_description: null | string; long_description: null | string; contact_email: null | string; website: null | string; data_shop_url: null | string; twitter_link: null | string; linkedin_link: null | string; image_url: string | null; status: CompanyScopeStatus; visibility: CompanyScopeVisibility; } /** * Lifecycle status of a company. The wire literals come from the shared * `CompanyCommonCodecs` (authoritative over the public schema, which lists a * stale `deleted` value). */ export type CompanyScopeStatus = "active" | "archived" | "pending"; /** * Discovery visibility of a company. The wire literals come from the shared * `CompanyCommonCodecs` (note the hyphenated `invisible-in-discover`, not the * schema's underscored spelling). */ export type CompanyScopeVisibility = "invisible" | "invisible-in-discover" | "visible"; /** * Access levels a permission may grant. Scoped to this module (`Whoami*`) to * avoid colliding with similarly-named types exported by other modules (e.g. * `Resource` from `../resources`) via the package's `export *` barrel. */ export type WhoamiAccess = "read" | "write" | "admin"; /** * Resources a permission may apply to. Scoped to this module (`Whoami*`) to * avoid colliding with similarly-named types exported by other modules (e.g. * `Resource` from `../resources`) via the package's `export *` barrel. */ export type WhoamiResource = "api_info" | "attributes" | "apps" | "app_profiles" | "resources" | "charges" | "datasets" | "data_streams" | "deliveries" | "destinations" | "forecasts" | "installations" | "lists" | "mappings" | "internal_reports" | "subscriptions" | "payment_methods" | "uploads" | "company_info" | "schema_preset"; export interface WhoamiPermission { resource: WhoamiResource; access: WhoamiAccess[]; }