/** * Copyright 2023 Kapeta Inc. * SPDX-License-Identifier: BUSL-1.1 */ import { StormEvent, StormEventPhases, StormEventPhaseType } from './events'; import { BlockDefinition, Plan } from '@kapeta/schemas'; import { KapetaURI } from '@kapeta/nodejs-utils'; export interface BlockDefinitionInfo { uri: string; content: BlockDefinition; aiName: string; archetype?: string; } export interface StormDefinitions { plan: Plan; blocks: BlockDefinitionInfo[]; } export interface StormOptions { databaseKind: string; apiKind: string; clientKind: string; webPageKind: string; webFragmentKind: string; mqKind: string; serviceKind: string; serviceLanguage: string; frontendKind: string; frontendLanguage: string; htmlLanguage: string; exchangeKind: string; queueKind: string; publisherKind: string; subscriberKind: string; jwtProviderKind: string; jwtConsumerKind: string; smtpKind: string; externalApiKind: string; cliKind: string; cliLanguage: string; desktopKind: string; desktopLanguage: string; gatewayKind: string; systemId?: string; [key: string]: string | undefined; } export declare function createPhaseStartEvent(type: StormEventPhaseType): StormEventPhases; export declare function createPhaseEndEvent(type: StormEventPhaseType): StormEventPhases; export declare function createPhaseEvent(start: boolean, type: StormEventPhaseType): StormEventPhases; export declare function resolveOptions(): Promise; export declare class StormEventParser { static toInstanceId(handle: string, blockName: string): string; static toInstanceIdFromRef(ref: string): string; static toSafeName(name: string): string; static toSafeArtifactName(name: string): string; static toRef(handle: string, name: string): KapetaURI; private events; private planName; private planDescription; private blocks; private connections; private failed; private error; private options; constructor(options: StormOptions); private reset; /** * Builds plan and block definitions - and enriches events with relevant refs and ids */ processEvent(handle: string, evt: StormEvent): Promise; getEvents(): StormEvent[]; isValid(): boolean; getError(): string; toResult(handle: string, warn?: boolean): Promise; toBlockDefinitions(handle: string): Promise<{ [key: string]: BlockDefinitionInfo; }>; private createBlockDefinitionInfo; private toResourceKind; private toBlockKind; private toConnectionMapping; private toPortType; private toBlockTarget; private toBlockTargetKind; private resolveArchetypeBlockDefinition; }