import { FunctionlessNode } from "@functionless/ast"; import { States, CommonFields, Task, State, Pass, Condition, Parameters } from "./states"; import { ASL } from "./synth"; /** * ASL Graph is an intermediate API used to represent a nested and dynamic ASL State Machine Graph. * * Unlike ASL, the ASL graph supports nested nodes, can associate nodes to {@link FunctionlessNode}s, and contains a representation of the output of a state. * * ASL Graph is completely stateless. */ export declare namespace ASLGraph { /** * Used by integrations as a placeholder for the "Next" property of a task. * * When task.Next is ASLGraph.DeferNext, Functionless will replace the Next with the appropriate value. * It may also add End or ResultPath based on the scenario. */ const DeferNext = "__DeferNext"; function isSubState(state: ASLGraph.NodeState | ASLGraph.SubState | ASLGraph.NodeResults): state is ASLGraph.SubState; /** * A Sub-State is a collection of possible return values. * A start state is the first state in the result. It will take on the name of the parent statement node. * States are zero to many named states or sub-stages that will take on the name of the parent statement node. */ interface SubState { startState: string; node?: FunctionlessNode; states: Record; } const isStateOrSubState: (a: any) => a is State | SubState; /** * An {@link ASLGraph} interface which adds an optional {@link FunctionlessNode} to a state. * * The node is used to name the state. */ type NodeState = State & { node?: FunctionlessNode; }; /** * The possible outputs of evaluating an {@link Expr}. * * State - A state with an {@link ASLGraph.Output} and optional {@link FunctionlessNode} * SubStates - A sub-state graph with an {@link ASLGraph.Output} and optional {@link FunctionlessNode} * JsonPath - a JSON Path Variable Reference, the consumer should use where json path is valid, ignore, or fail. * Value - a Value of type number, string, boolean, object, or null. Consumers should use where values can be used or turn into JsonPath using a {@link Pass} state. */ type NodeResults = ASLGraph.OutputState | ASLGraph.OutputSubState | ASLGraph.Output; /** * A compound state is a state node that may contain a simple Constant or Variable output instead of * built states or sub-states. * * Compound states are designed to be incorporated into existing states or turned into * states before they are returned up. * * Compound states cannot be nested in sub-states. */ interface OutputSubState extends ASLGraph.SubState { output: ASLGraph.Output; } /** * An {@link ASLGraph} interface which adds an {@link ASLGraph.Output} a state. * * The node is used to name the state. */ type OutputState = NodeState & { output: ASLGraph.Output; }; function isOutputStateOrSubState(state: any): state is ASLGraph.OutputSubState | ASLGraph.OutputState; type LiteralValueType = undefined | string | number | null | boolean | { [key: string]: LiteralValueType; } | LiteralValueType[]; /** * A literal value of type string, number, boolean, object, or null. * * If this is an Object, the object may contain nested JsonPaths as denoted by `containsJsonPath`. */ interface LiteralValue { /** * Whether there is json path in the constant. * * Helps determine where this constant can go for validation and * when false use Result in a Pass State instead of Parameters */ containsJsonPath: boolean; value: Value; } /** * A json path based state values reference. */ interface JsonPath { jsonPath: string; } interface ConditionOutput { condition: Condition; } type Output = ASLGraph.LiteralValue | ASLGraph.JsonPath | ASLGraph.ConditionOutput; interface IntrinsicFunction { funcName: string; args: (ASLGraph.JsonPath | ASLGraph.LiteralValue | ASLGraph.IntrinsicFunction)[]; } function isLiteralValue(state: any): state is ASLGraph.LiteralValue; function isLiteralNull(state: any): state is ASLGraph.LiteralValue; function isLiteralUndefined(state: any): state is ASLGraph.LiteralValue; function isLiteralNumber(state: any): state is ASLGraph.LiteralValue; function isLiteralString(state: any): state is ASLGraph.LiteralValue; function isLiteralArray(state: any): state is ASLGraph.LiteralValue; function isLiteralObject(state: any): state is ASLGraph.LiteralValue>; function isJsonPath(state: any): state is ASLGraph.JsonPath; function isIntrinsicFunction(state: any): state is ASLGraph.IntrinsicFunction; function isConditionOutput(state: any): state is ASLGraph.ConditionOutput; const isAslGraphOutput: (a: any) => a is JsonPath | ConditionOutput | LiteralValue; /** * Wires together an array of {@link State} or {@link ASLGraph.SubState} nodes in the order given. * Any state which is missing Next/End will be given a Next value of the next state with the final state * either being left as is. */ function joinSubStates(node?: FunctionlessNode, ...subStates: (ASLGraph.NodeState | ASLGraph.SubState | ASLGraph.NodeResults | undefined)[]): ASLGraph.SubState | ASLGraph.NodeState | undefined; /** * Used to lazily provide the next step to a provided state or nested set of states. * * Recursively traverse sub-states down to regular states, replacing any * nodes with `Next: ASLGraph.DeferNext` or `Next: undefined` with the given props. * * Note: States without `Next` are ignored and {@link Map} states replace Default and `Choices[].Next` instead. */ function updateDeferredNextStates(props: { End: true; OutputPath?: string; } | { Next: string; }, state: T): T; /** * Helper which can update a Asl state to a new output. * Sometimes the output can be updated in places like when accessing a constant or variable. * * If the state is a compound state, only the output needs to change, not the states it contains. * * ```ts * const obj = { a: { b: 1 } }; * return obj.a.b; * ``` * * output of obj.a * { startState: ..., states: {...}, output: { jsonPath: "$.obj.a" } } * * output of obj.a.b * { startState: ..., states: {...}, output: { jsonPath: "$.obj.a.b" } } * * Only the jsonPath has been mutated because no one used use intermediate output. */ function updateAslStateOutput(state: ASLGraph.NodeResults, newOutput: ASLGraph.Output): LiteralValue | JsonPath | ConditionOutput | { output: Output; Type: "Choice"; Choices: import("./states").Branch[]; Default?: string | undefined; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Type: "Fail"; Error?: string | undefined; Cause?: string | undefined; Comment?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; Next: string; End?: undefined; Parameters?: Parameters | undefined; ResultSelector?: Parameters | undefined; ResultPath?: string | null | undefined; Retry?: import("./states").Retry[] | undefined; Catch?: import("./states").Catch[] | undefined; Type: "Map"; Iterator: import("./states").StateMachine; ItemsPath?: string | undefined; MaxConcurrency?: number | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; End: true; Next?: undefined; Parameters?: Parameters | undefined; ResultSelector?: Parameters | undefined; ResultPath?: string | null | undefined; Retry?: import("./states").Retry[] | undefined; Catch?: import("./states").Catch[] | undefined; Type: "Map"; Iterator: import("./states").StateMachine; ItemsPath?: string | undefined; MaxConcurrency?: number | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; Next: string; End?: undefined; Parameters?: Parameters | undefined; ResultSelector?: Parameters | undefined; ResultPath?: string | null | undefined; Retry?: import("./states").Retry[] | undefined; Catch?: import("./states").Catch[] | undefined; Type: "Parallel"; Branches: import("./states").StateMachine[]; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; End: true; Next?: undefined; Parameters?: Parameters | undefined; ResultSelector?: Parameters | undefined; ResultPath?: string | null | undefined; Retry?: import("./states").Retry[] | undefined; Catch?: import("./states").Catch[] | undefined; Type: "Parallel"; Branches: import("./states").StateMachine[]; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; Next: string; End?: undefined; Type: "Pass"; Result?: any; ResultPath?: string | null | undefined; Parameters?: Parameters | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; End: true; Next?: undefined; Type: "Pass"; Result?: any; ResultPath?: string | null | undefined; Parameters?: Parameters | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Type: "Succeed"; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; Next: string; End?: undefined; Parameters?: Parameters | undefined; ResultSelector?: Parameters | undefined; ResultPath?: string | null | undefined; Retry?: import("./states").Retry[] | undefined; Catch?: import("./states").Catch[] | undefined; Type: "Task"; Resource: string; TimeoutSeconds?: number | undefined; TimeoutSecondsPath?: string | undefined; HeartbeatSeconds?: number | undefined; HeartbeatSecondsPath?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; End: true; Next?: undefined; Parameters?: Parameters | undefined; ResultSelector?: Parameters | undefined; ResultPath?: string | null | undefined; Retry?: import("./states").Retry[] | undefined; Catch?: import("./states").Catch[] | undefined; Type: "Task"; Resource: string; TimeoutSeconds?: number | undefined; TimeoutSecondsPath?: string | undefined; HeartbeatSeconds?: number | undefined; HeartbeatSecondsPath?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; Next: string; End?: undefined; Type: "Wait"; Seconds?: number | undefined; Timestamp?: string | undefined; SecondsPath?: string | undefined; TimestampPath?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; Comment?: string | undefined; InputPath?: string | undefined; OutputPath?: string | undefined; End: true; Next?: undefined; Type: "Wait"; Seconds?: number | undefined; Timestamp?: string | undefined; SecondsPath?: string | undefined; TimestampPath?: string | undefined; node?: FunctionlessNode | undefined; } | { output: Output; startState: string; node?: FunctionlessNode | undefined; states: Record; }; /** * Transforms an {@link ASLGraph.AslState} or {@link ASLGraph.SubState} into a ASL {@link States} collection of flat states. * * Uses the parent name as a starting point. All state nodes of sub-states will be given the name of their parent. * * Sub-States with local or relative state references will be rewritten to the updated parent state name. * * Removes unreachable states from the graph. Unreachable states will cause step functions to fail. * * sub state * ```ts * { * startState: "default", * states: { * default: { Next: 'b' }, * b: { Next: 'c' }, * c: { Next: 'externalState' } * } * } * ``` * * Parent state name: parentState * * rewrite * ```ts * { * parentState: { Next: 'b__parentState' }, * b__parentState: { Next: 'c__parentState' }, * c__parentState: { Next: 'externalState' } * } * ``` * * Local State Names * * In the below example, default, b, and c are all local state names. * * ```ts * { * startState: "default", * states: { * default: { Next: 'b' }, * b: { Next: 'c' }, * c: { Next: 'externalState' } * } * } * ``` * * Relative state names * * Path structures can be used to denote relative paths. ex: `../stateName`. * * ```ts * { * startState: "default", * states: { * default: { Next: 'b' }, * b: { * startState: "start", * states: { * start: { * Next: "../c" * } * } * }, * c: { Next: 'externalState' } * } * } * ``` * * In the above example, b/start's next state is c in it's parent state. * * Currently referencing child states (ex: `./b/start`) is not supported. * * All state names not found in local or parent sub-states will be assumed to be top level state names and will not be re-written. */ function toStates(startState: string, states: ASLGraph.NodeState | ASLGraph.SubState | ASLGraph.OutputState | ASLGraph.OutputSubState, getStateNames: (parentName: string, states: ASLGraph.SubState) => Record): States; /** * Normalized an ASL state to just the output (constant or variable). */ function getAslStateOutput(state: ASLGraph.NodeResults): ASLGraph.Output; /** * Applies an {@link ASLGraph.Output} to a partial {@link Pass}. * * {@link ASLGraph.ConditionOutput} must be first turned into a {@link ASLGraph.JsonPath}. */ function passWithInput(pass: Omit & CommonFields, value: Exclude): Pass; /** * Applies an {@link ASLGraph.Output} to a partial {@link Task} * * {@link ASLGraph.ConditionOutput} must be first turned into a {@link ASLGraph.JsonPath}. */ function taskWithInput(task: Omit & CommonFields, value: Exclude): Task; /** * As of Sept 2022, Step Functions failed validation when more than 10 intrinsic functions were nested. * The below functions attempt to bypass the issue by dynamically splitting trees of intrinsic functions * when the max is reached. */ const MAX_INTRINSIC_COUNT = 10; /** * Helper that generates a {@link Pass} state to assign a single jsonPath or intrinsic to * an output location. * * ```ts * assignJsonPathOrIntrinsic("out", "$.var", "States.Array(1,2,3)"); * ``` * * => * * ```ts * { * "Type": "Pass", * "Parameters": { * "out.$": "State.Array(1,2,3)" * }, * "Next": ASLGraph.DeferNext, * "ResultPath": "$.var", * "output": { "jsonPath": "$.var.out" } * } * ``` * * Note: when the nested intrinsic depth exceeds {@link ASLGraph.MAX_INTRINSIC_COUNT}, multiple states will be created to not hit the limit. * * @param jsonPathOrIntrinsic - json path (ex: $.var) or instrinsic function (ex: States.Array) to place into the output. */ function assignJsonPathOrIntrinsic(jsonPathOrIntrinsic: IntrinsicFunction | JsonPath, resultPath: string | ASLGraph.JsonPath, propertyName?: string, next?: string, node?: FunctionlessNode): ((ASLGraph.NodeState & Pass) | ASLGraph.OutputSubState) & { output: ASLGraph.JsonPath; }; /** * Render an {@link ASLGraph.IntrinsicFunction}. * * If an Intrinsic function contains nested intrinsic calls beyond {@link ASLGraph.MAX_INTRINSIC_COUNT}, * new states are also returned that render the nested calls in new Pass Parameters assignments. * * If the MAX is 2 for example `States.Call(States.Call(States.Call(), States.Call()))` * * The MAX of 2 means that having more than 2 intrinsic function calls in the same Parameter key will fail ASL validation. * * We would return the follow * * ``` * states => { * Pass, * Parameters: { * "d0.$": "States.Call()", * "d1.$": "States.Call()" * }, * ResultPath: "$.result.out" * } * * * rendered => "States.Call(States.Call($.result.out.d1, $.result.out.d1))" * ``` * * Notice that the given resultPath is used for the nested calls, meaning the * temporary values will be erased by the final assignment. */ function safeRenderIntrinsicFunction(jsonPathOrIntrinsic: IntrinsicFunction, resultPath: string | ASLGraph.JsonPath): { rendered: string; states?: ASLGraph.SubState | ASLGraph.NodeState; }; /** * Render an {@link ASLGraph.IntrinsicFunction}. * * This render method may produce an invalid intrinsic function is the depth is greater than {@link ASLGraph.MAX_INTRINSIC_COUNT}. * * Use {@link ASLGraph.safeRenderIntrinsicFunction} or {@link ASLGraph.renderMaxNestedIntrinsicFunctions} to handle functions that can hit a max depth. */ function renderIntrinsicFunction(func: IntrinsicFunction): string; /** * Render an {@link ASLGraph.IntrinsicFunction}. * * If an Intrinsic function contains nested intrinsic calls beyond {@link ASLGraph.MAX_INTRINSIC_COUNT}, * the `onMaxNestedReached` callback is called. * * If an {@link ASLGraph.IntrinsicFunction} is returned by the `onMaxNestedReached` callback, * the rest of this branch will render unsafe (using {@link ASLGraph.renderIntrinsicFunction}). */ function renderMaxNestedIntrinsicFunctions(func: IntrinsicFunction, onMaxNestedReached: (func: ASLGraph.IntrinsicFunction) => ASLGraph.JsonPath | ASLGraph.IntrinsicFunction): string; /** * Compare any two {@link ASLGraph.Output} values. */ function compareOutputs(leftOutput: ASLGraph.Output, rightOutput: ASLGraph.Output, operator: ASL.ValueComparisonOperators): Condition; /** * Compare a computed variable or unresolved conditional (left) to any other value (right). * * Comparing two literals is done with {@link ASLGraph.compareOutputs}. * * TODO: Implement abstract equality algorithm for `==` and `!=` * https://github.com/functionless/functionless/issues/445 * Current `==` and `===` are treated the same. */ function compare(left: ASLGraph.JsonPath | ASLGraph.ConditionOutput, right: ASLGraph.Output, operator: ASL.ValueComparisonOperators | "!=" | "!=="): Condition; /** * Provide comparison logic when right may be a string for any left value. * * if right is string literal or json path * typeof left === "string" && left === right * else * undefined */ function stringCompare(left: ASLGraph.JsonPath, right: ASLGraph.Output, operator: ASL.ValueComparisonOperators): Condition | undefined; /** * Provide comparison logic when right may be a number for any left value. * * if right is number literal or json path * typeof left === "number" && left === right * else * undefined */ function numberCompare(left: ASLGraph.JsonPath, right: ASLGraph.Output, operator: ASL.ValueComparisonOperators): Condition | undefined; /** * Provide comparison logic when right may be a boolean for any left value. * * If ==/=== * if left is a conditional * if right is a conditional * (!left && !right) || (left && right) * if right is boolean literal * right ? left : !left * if right is jsonPath * (!left && right === false) || (left && right === true) * if right is conditional * (!right && left === false) || (right && left === true) * if right is boolean literal or json path * typeof left === "boolean" && left === right * else * undefined */ function booleanCompare(left: ASLGraph.JsonPath | ASLGraph.ConditionOutput, right: ASLGraph.Output, operator: ASL.ValueComparisonOperators): Condition | undefined; /** * Provide comparison logic when right may be null for any left value. * * If ==/=== * if right is a variable - check for isNull(left) && isNull(right) * if right is null - check for isNull(left) * else * undefined * else * undefined */ function nullCompare(left: ASLGraph.JsonPath, right: ASLGraph.Output, operator: ASL.ValueComparisonOperators): Condition | undefined; /** * Provide comparison logic when right may be undefined for any left value. * * If ==/=== * if right is a variable - check for isNotPresent(left) && isNotPresent(right) * if right is undefined - check for isNotPresent(left) * else * undefined * else * undefined */ function undefinedCompare(left: ASLGraph.JsonPath, right: ASLGraph.Output, operator: ASL.ValueComparisonOperators): Condition | undefined; /** * Returns a object with the key formatted based on the contents of the value. * in ASL, object keys that reference json path values must have a suffix of ".$" * { "input.$": "$.value" } */ function jsonAssignment(key: string, output: Exclude): Record; /** * Safely sets a key into a literal object. * * In ASL, `key.$` and `key` are the same. If both exist at runtime, the machine will fail. * * { * key.$: $.value * } * set("key", "someConstant") * { * key: "someConstant" * } */ function setKeyOnLiteralObject(key: string, literalObject: ASLGraph.LiteralValue>, value: ASLGraph.LiteralValue | ASLGraph.JsonPath, containsJsonPath?: boolean): ASLGraph.LiteralValue>; /** * Merge two object literals together. */ function mergeLiteralObject(literalObject: ASLGraph.LiteralValue>, literalObject2: ASLGraph.LiteralValue>): ASLGraph.LiteralValue>; function isTruthyOutput(v: ASLGraph.Output): Condition; function elementIn(element: ASLGraph.LiteralValue | ASLGraph.LiteralValue, targetJsonPath: ASLGraph.JsonPath): Condition; /** * @param element - when true (or field is a number) the output json path will prefer to use the square bracket format. * `$.obj[field]`. When false will prefer the dot format `$.obj.field`. */ function accessConstant(value: ASLGraph.Output, field: ASLGraph.LiteralValue | ASLGraph.LiteralValue, element: boolean): ASLGraph.JsonPath | ASLGraph.LiteralValue; /** * Wraps any literal value which can be output an an ASL state. * * @param containsJsonPath - when true, denotes that an object contains json path in it's properties at any depth. * ```ts * { "key.$": "$.value" } * ``` * ```ts * { k: { "key.$": "$.value" } } * ``` */ function literalValue(value: V, containsJsonPath?: boolean): ASLGraph.LiteralValue; /** * Represents any json path output by an ASL state. * * Provides a friendly helper for formatting json path segments. * * ```ts * const j = ASLGraph.jsonPath("$.path", "seg"); * j.jsonPath // $.path.seg * ``` */ function jsonPath(jsonPath: string | JsonPath, ...segment: string[]): JsonPath; /** * Represents a conditional statement which can be returned from a state. * * For example * * ```ts * x === 1 // ASLGraph.conditionOutput(ASL.equals(...)) * ``` */ function conditionOutput(condition: Condition): { condition: Condition; }; /** * Formats an intrinsic function. * * ```ts * ASLGraph.intrinsicFunction("States.Format", `'{}{}'`, ASLGraph.jsonPath("$.val"), ASLGraph.literalValue("someString")); * ``` * => * "States.format('{}{}', $.val, 'someString')" */ function intrinsicFunction(name: string, ...args: (ASLGraph.JsonPath | ASLGraph.LiteralValue | ASLGraph.IntrinsicFunction)[]): IntrinsicFunction; /** * States.Format(template, ...args) * * @param template used to format the values. A bare string will be quoted. * `intrinsicFormat("{}", ASLGraph.jsonPath("$.a"))` => States.Format('{}', $.a) */ function intrinsicFormat(template: string | ASLGraph.JsonPath | ASLGraph.LiteralValue, ...args: (ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue)[]): IntrinsicFunction; /** * States.StringSplit(value, separator) * * @param value to split. * @param separator used to split the value. */ function intrinsicStringSplit(value: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue, separator: ASLGraph.IntrinsicFunction | (ASLGraph.JsonPath | ASLGraph.LiteralValue)): IntrinsicFunction; /** * States.StringToJson(value) * * @param value to turn to json. */ function intrinsicStringToJson(value: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.JsonToString(value) * * @param value to turn to a string. */ function intrinsicJsonToString(value: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue | ASLGraph.LiteralValue | ASLGraph.LiteralValue | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.ArrayGet(arr, index) * * @param arr to access. * @param index position to access. */ function intrinsicArrayGetItem(arr: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath, index: number | ASLGraph.JsonPath | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.ArrayContains(arr, item) * * @param arr to access. * @param item to search for. */ function intrinsicArrayContains(arr: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath, item: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.ArrayLength(arr, index) * * @param arr to get length of */ function intrinsicArrayLength(arr: ASLGraph.IntrinsicFunction | ASLGraph.JsonPath): IntrinsicFunction; /** * States.ArrayRange(start, end, step) * * @param start inclusive start value of the output array * @param end inclusive end value of the output array * @param step increment to step between start and range */ function intrinsicArrayRange(start: number | ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue, end: number | ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue, step: number | ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.Array(start, end, step) * * @param items to put in the list */ function intrinsicArray(...items: (ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue | any[]>>)[]): IntrinsicFunction; /** * States.ArrayPartition(arr, size) */ function intrinsicArrayPartition(arr: ASLGraph.JsonPath, partitionSize: ASLGraph.JsonPath | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.ArrayUnique(arr) */ function intrinsicArrayUnique(arr: ASLGraph.JsonPath): IntrinsicFunction; /** * States.JsonMerge(left, right, false) * * Shallowly merges two json objects together. */ function intrinsicJsonMerge(left: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction, right: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction): IntrinsicFunction; /** * States.Base64Encode(data) */ function intrinsicBase64Encode(data: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.Base64Decode(data) */ function intrinsicBase64Decode(data: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue): IntrinsicFunction; const HashAlgorithms: readonly ["MD5", "SHA-1", "SHA-256", "SHA-384", "SHA-512"]; /** * @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html#asl-intrsc-func-hash-calc */ type HashAlgorithm = typeof HashAlgorithms[number]; /** * States.Hash(data, algorithm) */ function intrinsicHash(data: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue, algorithm: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.MathAdd(left, right) */ function intrinsicMathAdd(left: number | ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue, right: number | ASLGraph.IntrinsicFunction | ASLGraph.JsonPath | ASLGraph.LiteralValue): IntrinsicFunction; /** * States.MathRandom(start, end, seed) */ function intrinsicMathRandom(start: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue, end: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue, seed?: ASLGraph.JsonPath | ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue): IntrinsicFunction; function escapeFormatLiteralString(literal: ASLGraph.LiteralValue): string; /** * Escape special characters in Step Functions intrinsics. * * } => \} * { => \{ * ' => \' * * https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html#amazon-states-language-intrinsic-functions-escapes */ function escapeFormatLiteral(literal: ASLGraph.LiteralValue): LiteralValueType; /** * Turns any literal value in a string or intrinsic functions that can generate a string representation. * * ```ts * literalValue("value") // => "value" * literalValue(1) // => "1" * literalValue({ a: 1 }) // => "{ \"a\": "1" }"" * literalValue({ "a.$": "$.var" }) => intrinsicFormat('{ "a": {} }', JsonToString("$.var")) * literalValue([1]) // => "[1]" * literalValue(["$.var"]) => intrinsicFormat('[{}]', JsonToString("$.var")) * ``` */ function stringifyLiteral(value: ASLGraph.LiteralValue): ASLGraph.IntrinsicFunction | ASLGraph.LiteralValue; } export declare const deploymentOnlyModule = true; //# sourceMappingURL=asl-graph.d.ts.map