Skip to content

Commit

Permalink
chore(pipes): Remove interface complexity of InputTransformation
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelManke committed Jan 21, 2024
1 parent 2fd7d74 commit f8481f4
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions packages/@aws-cdk/aws-pipes-alpha/lib/inputTransformation.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
import { DefaultTokenResolver, IResolveContext, Lazy, StringConcat, Token, Tokenization } from 'aws-cdk-lib';
import { IPipe } from './pipe';
import { DynamicInput, PipeVariable } from './pipeVariable';
import { unquote } from './unquote';

type StaticString = string;
type KeyValue = Record<string, string | PipeVariable>;
type StaticJsonFlat = Record<string, StaticString | KeyValue>;
type InputTransformJson = Record<string, StaticString | KeyValue | StaticJsonFlat | IInputTransformation[] | StaticString [] | DynamicInput>;

type InputTransformationValue = StaticString | InputTransformJson;
type InputTransformationValue = string | Record<string, any>;

/**
* The inputTemplate that is used to transform the input event payload with unquoted variables
Expand Down Expand Up @@ -42,7 +36,7 @@ export class InputTransformation implements IInputTransformation {
/**
* Creates an InputTransformation from a string.
*/
static fromText(inputTemplate: StaticString): InputTransformation {
static fromText(inputTemplate: string): InputTransformation {
return new InputTransformation(inputTemplate, TemplateType.TEXT);
}

Expand All @@ -60,7 +54,7 @@ export class InputTransformation implements IInputTransformation {
/**
* Creates an InputTransformation from a pipe variable.
*/
static fromObject(inputTemplate: InputTransformJson): InputTransformation {
static fromObject(inputTemplate: Record<string, any>): InputTransformation {
return new InputTransformation(inputTemplate, TemplateType.OBJECT);
}

Expand Down

0 comments on commit f8481f4

Please sign in to comment.