@finos/legend-application-studio
Version:
Legend Studio application core
166 lines • 8.37 kB
TypeScript
/**
* Copyright (c) 2020-present, Goldman Sachs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { type GeneratorFn } from '@finos/legend-shared';
import type { ServiceEditorState } from './ServiceEditorState.js';
import { RuntimeEditorState } from '../../../editor-state/element-editor-state/RuntimeEditorState.js';
import { type ServiceExecution, type PureExecution, type Mapping, type Runtime, type PackageableElementReference, type ExecutionResultWithMetadata, type Service, PureSingleExecution, PureMultiExecution, KeyedExecutionParameter, RawLambda } from '@finos/legend-graph';
import type { EditorStore } from '../../../EditorStore.js';
import { LambdaEditorState, LambdaParametersState, LambdaParameterState, QueryLoaderState, ExecutionPlanState, LineageState } from '@finos/legend-query-builder';
export declare class ServiceExecutionParametersState extends LambdaParametersState {
executionState: ServicePureExecutionState;
constructor(executionState: ServicePureExecutionState);
openModal(query: RawLambda): void;
openDataCubeModal(query: RawLambda, element: Service, editorStore: EditorStore): void;
build(query: RawLambda): LambdaParameterState[];
}
export declare abstract class ServiceExecutionState {
readonly editorStore: EditorStore;
readonly serviceEditorState: ServiceEditorState;
readonly execution: ServiceExecution;
constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: ServiceExecution);
abstract get serviceExecutionParameters(): {
query: RawLambda;
mapping: Mapping;
runtime: Runtime;
} | undefined;
}
export declare class UnsupportedServiceExecutionState extends ServiceExecutionState {
get serviceExecutionParameters(): {
query: RawLambda;
mapping: Mapping;
runtime: Runtime;
} | undefined;
}
export declare class ServicePureExecutionQueryState extends LambdaEditorState {
readonly editorStore: EditorStore;
readonly queryLoaderState: QueryLoaderState;
execution: PureExecution;
isInitializingLambda: boolean;
constructor(editorStore: EditorStore, execution: PureExecution);
get lambdaId(): string;
get query(): RawLambda;
setIsInitializingLambda(val: boolean): void;
setLambda(val: RawLambda): void;
importQuery(selectedQueryID: string): GeneratorFn<void>;
updateLamba(val: RawLambda): GeneratorFn<void>;
convertLambdaObjectToGrammarString(options?: {
pretty?: boolean | undefined;
}): GeneratorFn<void>;
convertLambdaGrammarStringToObject(): GeneratorFn<void>;
}
export interface ServiceExecutionContext {
mapping: PackageableElementReference<Mapping>;
runtime: Runtime;
}
export declare abstract class ServiceExecutionContextState {
executionState: ServiceExecutionState;
constructor(executionState: ServiceExecutionState);
abstract get executionContext(): ServiceExecutionContext;
abstract setMapping(value: Mapping): void;
abstract setRuntime(value: Runtime): void;
}
export declare class SingleExecutionContextState extends ServiceExecutionContextState {
executionState: SingleServicePureExecutionState;
constructor(executionState: SingleServicePureExecutionState);
setMapping(value: Mapping): void;
setRuntime(value: Runtime): void;
get executionContext(): ServiceExecutionContext;
}
export declare class KeyedExecutionContextState extends ServiceExecutionContextState {
keyedExecutionParameter: KeyedExecutionParameter;
constructor(keyedExecutionParameter: KeyedExecutionParameter, executionState: MultiServicePureExecutionState);
setMapping(value: Mapping): void;
setRuntime(value: Runtime): void;
get executionContext(): ServiceExecutionContext;
}
export declare abstract class ServicePureExecutionState extends ServiceExecutionState {
execution: PureExecution;
queryState: ServicePureExecutionQueryState;
selectedExecutionContextState: ServiceExecutionContextState | undefined;
runtimeEditorState?: RuntimeEditorState | undefined;
isOpeningQueryEditor: boolean;
showChangeExecModal: boolean;
isRunningQuery: boolean;
isGeneratingPlan: boolean;
isGeneratingLineage: boolean;
executionResultText?: string | undefined;
executionPlanState: ExecutionPlanState;
readonly parametersState: ServiceExecutionParametersState;
queryRunPromise: Promise<ExecutionResultWithMetadata> | undefined;
lineageState: LineageState;
constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureExecution);
abstract changeExecution(): void;
isChangeExecutionDisabled(): boolean;
setIsRunningQuery(val: boolean): void;
setShowChangeExecModal(val: boolean): void;
setOpeningQueryEditor(val: boolean): void;
setExecutionResultText: (executionResult: string | undefined) => void;
setQueryState: (queryState: ServicePureExecutionQueryState) => void;
setQueryRunPromise: (promise: Promise<ExecutionResultWithMetadata> | undefined) => void;
handleOpeningDataCube(element: Service, editorStore: EditorStore): Promise<void>;
openingDataCube(element: Service, editorStore: EditorStore): Promise<void>;
generatePlan(debug: boolean): GeneratorFn<void>;
handleRunQuery(): GeneratorFn<void>;
runQuery(): GeneratorFn<void>;
cancelQuery(): GeneratorFn<void>;
generateLineage(): GeneratorFn<void>;
get serviceExecutionParameters(): {
query: RawLambda;
mapping: Mapping;
runtime: Runtime;
} | undefined;
closeRuntimeEditor(): void;
openRuntimeEditor(): void;
useCustomRuntime(): void;
autoSelectRuntimeOnMappingChange(mapping: Mapping): void;
abstract getInitiallySelectedExecutionContextState(): ServiceExecutionContextState | undefined;
updateExecutionQuery(): void;
}
export declare class InlineServicePureExecutionState extends ServicePureExecutionState {
execution: PureSingleExecution;
constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureSingleExecution);
changeExecution(): void;
getInitiallySelectedExecutionContextState(): ServiceExecutionContextState | undefined;
}
export declare class SingleServicePureExecutionState extends ServicePureExecutionState {
execution: PureSingleExecution;
selectedExecutionContextState: ServiceExecutionContextState;
multiExecutionKey: string;
constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureSingleExecution);
isChangeExecutionDisabled(): boolean;
getInitiallySelectedExecutionContextState(): ServiceExecutionContextState;
setMultiExecutionKey(val: string): void;
changeExecution(): void;
}
export declare class MultiServicePureExecutionState extends ServicePureExecutionState {
execution: PureMultiExecution;
newKeyParameterModal: boolean;
renameKey: KeyedExecutionParameter | undefined;
singleExecutionKey: KeyedExecutionParameter | undefined;
constructor(editorStore: EditorStore, serviceEditorState: ServiceEditorState, execution: PureMultiExecution);
get keyedExecutionParameters(): KeyedExecutionParameter[];
setSingleExecutionKey(val: KeyedExecutionParameter | undefined): void;
changeExecution(): void;
setRenameKey(key: KeyedExecutionParameter | undefined): void;
setNewKeyParameterModal(val: boolean): void;
setExecutionKey(val: string): void;
getInitiallySelectedExecutionContextState(): ServiceExecutionContextState | undefined;
changeKeyedExecutionParameter(value: KeyedExecutionParameter): void;
deleteKeyExecutionParameter(value: KeyedExecutionParameter): void;
addExecutionParameter(value: string): void;
changeKeyValue(key: KeyedExecutionParameter, value: string): void;
}
//# sourceMappingURL=ServiceExecutionState.d.ts.map