export interface UserMeDto { user: User; organizations: Organization[]; agents: Agent[]; flagBootstrap: FlagBootstrap; } export interface FlagBootstrap { "ui.enable-resource-signing"?: boolean; "superblocks.git.split.large.steps.enabled"?: boolean; "superblocks.git.split.large.steps.new.enabled"?: boolean; "superblocks.git.split.large.step.lines"?: number; } export type User = { id: string; email: string; currentOrganizationId: string; organizationIds: string[]; username: string; name: string; anonymousId: string; isAnonymous: boolean; isAdmin: boolean; metadata: Record; }; export interface Organization { id: string; name: string; displayName: string; agents?: Agent[]; apiKey: string; agentType: AgentType; minExternalAgentVersion: string; profiles?: Profile[]; } export type Agent = { id: string; key: string; environment: string; status: AgentStatus; version: string; versionExternal: string; url: string; type: AgentType; updated: Date; created: Date; tags: AgentTags; verificationKeyIds?: null | string[]; signingKeyId?: null | string; }; export enum AgentStatus { ACTIVE = "Active", DISCONNECTED = "Disconnected", BROWSER_UNREACHABLE = "Browser Unreachable", // TODO: remove PENDING_REGISTRATION after the DB migration PENDING_REGISTRATION = "Pending Registration", STALE = "Stale", } export enum AgentType { MULTITENANT = 0, DEDICATED = 1, ONPREMISE = 2, } export type AgentTags = Record; export class Profile { id: string; key: string; displayName: string; description: string; type: ProfileType; constructor({ id, key, displayName, description, type, }: { id: string; key: string; displayName: string; description: string; type: ProfileType; }) { this.id = id; this.key = key; this.displayName = displayName; this.description = description; this.type = type; } } export enum ProfileType { RESERVED = "RESERVED", CUSTOM = "CUSTOM", } export type Api = { metadata: { name: string; id: string; organization: string; timestamps?: { created: string; updated: string; deactivated: boolean; }; // These properties are merged in from the v3 api entity creator?: { id: string; name: string; }; folder?: string; }; blocks?: Block[]; trigger: any; signature?: Signature; }; export type ApiWithPb = { id: string; pageId?: string; apiPb: Api; }; export type Block = { name: string; step?: Step; loop?: Loop; tryCatch?: TryCatch; conditional?: Conditional; parallel?: Parallel; stream?: Stream; }; export type Step = { integration: string; javascript?: LanguageContent; python?: LanguageContent; }; export type Loop = { blocks: Block[]; range: string; type: LoopType; variables?: Variables; }; export enum LoopType { FOR = "TYPE_FOR", FOR_EACH = "TYPE_FOREACH", WHILE = "TYPE_WHILE", UNSPECIFIED = "TYPE_UNSPECIFIED", } export type TryCatch = { try?: Blocks; catch?: Blocks; finally?: Blocks; variables?: Variables; }; export type Conditional = { if?: ConditionalBlockWithCondition; elseIf: ConditionalBlockWithCondition[]; else?: Blocks; }; export type Blocks = { blocks: Block[]; }; export type ConditionalBlockWithCondition = Blocks & { condition?: string; }; export type Parallel = { static?: { paths: Record; }; dynamic?: { blocks: Block[]; variables?: Variables; paths?: string; }; poolSize?: number; wait?: WAIT_TYPE; }; export type Stream = { trigger?: StreamTrigger; process?: Blocks; variables?: Variables; }; export type StreamTrigger = { name: string; step?: Step; }; export enum WAIT_TYPE { ALL = "WAIT_ALL", ANY = "WAIT_NONE", UNSPECIFIED = "WAIT_UNSPECIFIED", } export type Variables = Record; export type LanguageContent = { body: Body; }; export type Body = string | { path: string }; export type Page = { id: string; applicationId: string; isHidden: boolean; layouts: Record[]; name: string; apis: ApiWithPb[]; }; /** A signature, as produced by the agent. */ export interface Signature { /** The id of the key used to sign the data. */ keyId: string; /** The actual signature, in base64. */ data: string; } export interface RemoteCommitDto { commitId: string; remoteCommitId: string; remoteCommitDate: Date; branchName: string; repositoryId: string; } export interface DeploymentDto { commitId: string; previousCommitId?: string | null; entityId: string; deployer: { id: string; email: string; name: string; }; deploymentId: string; deployMessage: string; deploymentTime: number; } export type ViewMode = | "export-deployed" | "export-latest" | "export-live" | "export-commit";