| import { z } from "zod"; |
|
|
| import type { LabelAssignment } from "./enrichment.js"; |
| import type { PooledTweet } from "./tweet.js"; |
|
|
| |
| export const serviceAccountScopeSchema = z.enum(["units:read", "taxonomy:read"]); |
|
|
| export type ServiceAccountScope = z.infer<typeof serviceAccountScopeSchema>; |
|
|
| |
| |
| |
| |
| |
| export type EnrichedUnit = { |
| id: string; |
| posts: readonly PooledTweet[]; |
| contributors: readonly string[]; |
| preset_labels: readonly LabelAssignment[]; |
| free_labels: readonly LabelAssignment[]; |
| }; |
|
|
| |
| export type UnitPage = { |
| revision: string; |
| cutoff?: string; |
| units: readonly EnrichedUnit[]; |
| next_cursor?: string; |
| }; |
|
|
| export type ServiceAccountKeySummary = { |
| id: string; |
| created_at: string; |
| expires_at?: string; |
| }; |
|
|
| export type ServiceAccountSummary = { |
| id: string; |
| name: string; |
| scopes: readonly ServiceAccountScope[]; |
| status: "active" | "revoked"; |
| created_at: string; |
| updated_at: string; |
| keys: readonly ServiceAccountKeySummary[]; |
| }; |
|
|
| export type ServiceAccountsSnapshot = { |
| version: 1; |
| accounts: readonly ServiceAccountSummary[]; |
| source: "dataset" | "empty"; |
| config_error?: string; |
| }; |
|
|
| |
| export type IssuedServiceAccountCredential = { |
| account: ServiceAccountSummary; |
| token: string; |
| }; |
|
|