agent-claw: automated task changes

This commit is contained in:
daniel
2026-05-06 18:55:16 -05:00
parent 38905bb1e9
commit 732b00fb66
8494 changed files with 2018127 additions and 4 deletions

View File

@@ -0,0 +1,13 @@
{
"targets": {
"java": {
"package": "software.amazon.awscdk.services.stepfunctions"
},
"dotnet": {
"namespace": "Amazon.CDK.AWS.StepFunctions"
},
"python": {
"module": "aws_cdk.aws_stepfunctions"
}
}
}

1759
cdk/node_modules/aws-cdk-lib/aws-stepfunctions/README.md generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
export * from './lib';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,143 @@
import type { Construct } from 'constructs';
import type { EncryptionConfiguration } from './encryption-configuration';
import * as cloudwatch from '../../aws-cloudwatch';
import * as iam from '../../aws-iam';
import type { IResource } from '../../core';
import { Resource } from '../../core';
import type { ActivityReference, IActivityRef } from '../../interfaces/generated/aws-stepfunctions-interfaces.generated';
/**
* Properties for defining a new Step Functions Activity
*/
export interface ActivityProps {
/**
* The name for this activity.
*
* @default - If not supplied, a name is generated
*/
readonly activityName?: string;
/**
* The encryptionConfiguration object used for server-side encryption of the activity inputs.
*
* @default - data is transparently encrypted using an AWS owned key
*/
readonly encryptionConfiguration?: EncryptionConfiguration;
}
/**
* Define a new Step Functions Activity
*/
export declare class Activity extends Resource implements IActivity {
/** Uniquely identifies this class. */
static readonly PROPERTY_INJECTION_ID: string;
/**
* Construct an Activity from an existing Activity ARN
*/
static fromActivityArn(scope: Construct, id: string, activityArn: string): IActivity;
/**
* Construct an Activity from an existing Activity Name
*/
static fromActivityName(scope: Construct, id: string, activityName: string): IActivity;
/**
* @attribute
*/
readonly encryptionConfiguration?: EncryptionConfiguration;
private readonly resource;
get activityArn(): string;
get activityName(): string;
get activityRef(): ActivityReference;
constructor(scope: Construct, id: string, props?: ActivityProps);
/**
* Grant the given identity permissions on this Activity
*
* [disable-awslint:no-grants]
*
* @param identity The principal
* @param actions The list of desired actions
*/
grant(identity: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Return the given named metric for this Activity
*
* @default sum over 5 minutes
*/
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* The interval, in milliseconds, between the time the activity starts and the time it closes.
*
* @default average over 5 minutes
*/
metricRunTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* The interval, in milliseconds, for which the activity stays in the schedule state.
*
* @default average over 5 minutes
*/
metricScheduleTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* The interval, in milliseconds, between the time the activity is scheduled and the time it closes.
*
* @default average over 5 minutes
*/
metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity is scheduled
*
* @default sum over 5 minutes
*/
metricScheduled(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity times out
*
* @default sum over 5 minutes
*/
metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity is started
*
* @default sum over 5 minutes
*/
metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity succeeds
*
* @default sum over 5 minutes
*/
metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity fails
*
* @default sum over 5 minutes
*/
metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times the heartbeat times out for this activity
*
* @default sum over 5 minutes
*/
metricHeartbeatTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
private generateName;
private cannedMetric;
}
/**
* Represents a Step Functions Activity
* https://docs.aws.amazon.com/step-functions/latest/dg/concepts-activities.html
*/
export interface IActivity extends IResource, IActivityRef {
/**
* The ARN of the activity
*
* @attribute
*/
readonly activityArn: string;
/**
* The name of the activity
*
* @attribute
*/
readonly activityName: string;
/**
* The encryptionConfiguration object used for server-side encryption of the activity inputs
*
* @attribute
*/
readonly encryptionConfiguration?: EncryptionConfiguration;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
import { EncryptionConfiguration } from './encryption-configuration';
/**
* Define a new AwsOwnedEncryptionConfiguration
*/
export declare class AwsOwnedEncryptionConfiguration extends EncryptionConfiguration {
constructor();
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.AwsOwnedEncryptionConfiguration=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var encryption_configuration_1=()=>{var tmp=require("./encryption-configuration");return encryption_configuration_1=()=>tmp,tmp};const AWS_OWNED_KEY="AWS_OWNED_KEY";class AwsOwnedEncryptionConfiguration extends encryption_configuration_1().EncryptionConfiguration{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.AwsOwnedEncryptionConfiguration",version:"2.252.0"};constructor(){super(AWS_OWNED_KEY)}}exports.AwsOwnedEncryptionConfiguration=AwsOwnedEncryptionConfiguration;

View File

@@ -0,0 +1,53 @@
import type { ParallelProps } from './states/parallel';
import { Parallel } from './states/parallel';
import type { State } from './states/state';
import type { IChainable, INextable } from './types';
/**
* A collection of states to chain onto
*
* A Chain has a start and zero or more chainable ends. If there are
* zero ends, calling next() on the Chain will fail.
*/
export declare class Chain implements IChainable {
private readonly lastAdded;
/**
* Begin a new Chain from one chainable
*/
static start(state: IChainable): Chain;
/**
* Make a Chain with the start from one chain and the ends from another
*/
static sequence(start: IChainable, next: IChainable): Chain;
/**
* Make a Chain with specific start and end states, and a last-added Chainable
*/
static custom(startState: State, endStates: INextable[], lastAdded: IChainable): Chain;
/**
* Identify this Chain
*/
readonly id: string;
/**
* The start state of this chain
*/
readonly startState: State;
/**
* The chainable end state(s) of this chain
*/
readonly endStates: INextable[];
private constructor();
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Return a single state that encompasses all states in the chain
*
* This can be used to add error handling to a sequence of states.
*
* Be aware that this changes the result of the inner state machine
* to be an array with the result of the state machine in it. Adjust
* your paths accordingly. For example, change 'outputPath' to
* '$[0]'.
*/
toSingleState(id: string, props?: ParallelProps): Parallel;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Chain=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp},parallel_1=()=>{var tmp=require("./states/parallel");return parallel_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class Chain{lastAdded;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Chain",version:"2.252.0"};static start(state){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(state)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.start),error}return new Chain(state.startState,state.endStates,state)}static sequence(start,next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(start),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.sequence),error}return new Chain(start.startState,next.endStates,next)}static custom(startState,endStates,lastAdded){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_State(startState),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(lastAdded)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.custom),error}return new Chain(startState,endStates,lastAdded)}id;startState;endStates;constructor(startState,endStates,lastAdded){this.lastAdded=lastAdded,this.id=lastAdded.id,this.startState=startState,this.endStates=endStates}next(next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}if(this.endStates.length===0)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`CannotChainToLastState`,`Cannot add to chain: last state in chain (${this.lastAdded.id}) does not allow it`);for(const endState of this.endStates)endState.next(next);return new Chain(this.startState,next.endStates,next)}toSingleState(id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ParallelProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toSingleState),error}return new(parallel_1()).Parallel(this.startState,id,props).branch(this)}}exports.Chain=Chain;

View File

@@ -0,0 +1,206 @@
/**
* A Condition for use in a Choice state branch
*/
export declare abstract class Condition {
/**
* Matches if variable is present
*/
static isPresent(variable: string): Condition;
/**
* Matches if variable is not present
*/
static isNotPresent(variable: string): Condition;
/**
* Matches if variable is a string
*/
static isString(variable: string): Condition;
/**
* Matches if variable is not a string
*/
static isNotString(variable: string): Condition;
/**
* Matches if variable is numeric
*/
static isNumeric(variable: string): Condition;
/**
* Matches if variable is not numeric
*/
static isNotNumeric(variable: string): Condition;
/**
* Matches if variable is boolean
*/
static isBoolean(variable: string): Condition;
/**
* Matches if variable is not boolean
*/
static isNotBoolean(variable: string): Condition;
/**
* Matches if variable is a timestamp
*/
static isTimestamp(variable: string): Condition;
/**
* Matches if variable is not a timestamp
*/
static isNotTimestamp(variable: string): Condition;
/**
* Matches if variable is not null
*/
static isNotNull(variable: string): Condition;
/**
* Matches if variable is Null
*/
static isNull(variable: string): Condition;
/**
* Matches if a boolean field has the given value
*/
static booleanEquals(variable: string, value: boolean): Condition;
/**
* Matches if a boolean field equals to a value at a given mapping path
*/
static booleanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a string field equals to a value at a given mapping path
*/
static stringEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a string field has the given value
*/
static stringEquals(variable: string, value: string): Condition;
/**
* Matches if a string field sorts before a given value
*/
static stringLessThan(variable: string, value: string): Condition;
/**
* Matches if a string field sorts before a given value at a particular mapping
*/
static stringLessThanJsonPath(variable: string, value: string): Condition;
/**
* Matches if a string field sorts equal to or before a given value
*/
static stringLessThanEquals(variable: string, value: string): Condition;
/**
* Matches if a string field sorts equal to or before a given mapping
*/
static stringLessThanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a string field sorts after a given value
*/
static stringGreaterThan(variable: string, value: string): Condition;
/**
* Matches if a string field sorts after a value at a given mapping path
*/
static stringGreaterThanJsonPath(variable: string, value: string): Condition;
/**
* Matches if a string field sorts after or equal to value at a given mapping path
*/
static stringGreaterThanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a string field sorts after or equal to a given value
*/
static stringGreaterThanEquals(variable: string, value: string): Condition;
/**
* Matches if a numeric field has the given value
*/
static numberEquals(variable: string, value: number): Condition;
/**
* Matches if a numeric field has the value in a given mapping path
*/
static numberEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a numeric field is less than the given value
*/
static numberLessThan(variable: string, value: number): Condition;
/**
* Matches if a numeric field is less than the value at the given mapping path
*/
static numberLessThanJsonPath(variable: string, value: string): Condition;
/**
* Matches if a numeric field is less than or equal to the given value
*/
static numberLessThanEquals(variable: string, value: number): Condition;
/**
* Matches if a numeric field is less than or equal to the numeric value at given mapping path
*/
static numberLessThanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a numeric field is greater than the given value
*/
static numberGreaterThan(variable: string, value: number): Condition;
/**
* Matches if a numeric field is greater than the value at a given mapping path
*/
static numberGreaterThanJsonPath(variable: string, value: string): Condition;
/**
* Matches if a numeric field is greater than or equal to the given value
*/
static numberGreaterThanEquals(variable: string, value: number): Condition;
/**
* Matches if a numeric field is greater than or equal to the value at a given mapping path
*/
static numberGreaterThanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is the same time as the given timestamp
*/
static timestampEquals(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is the same time as the timestamp at a given mapping path
*/
static timestampEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is before the given timestamp
*/
static timestampLessThan(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is before the timestamp at a given mapping path
*/
static timestampLessThanJsonPath(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is before or equal to the given timestamp
*/
static timestampLessThanEquals(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is before or equal to the timestamp at a given mapping path
*/
static timestampLessThanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is after the given timestamp
*/
static timestampGreaterThan(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is after the timestamp at a given mapping path
*/
static timestampGreaterThanJsonPath(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is after or equal to the given timestamp
*/
static timestampGreaterThanEquals(variable: string, value: string): Condition;
/**
* Matches if a timestamp field is after or equal to the timestamp at a given mapping path
*/
static timestampGreaterThanEqualsJsonPath(variable: string, value: string): Condition;
/**
* Matches if a field matches a string pattern that can contain a wild card (*) e.g: log-*.txt or *LATEST*.
* No other characters other than "*" have any special meaning - * can be escaped: \\*
*/
static stringMatches(variable: string, value: string): Condition;
/**
* Combine two or more conditions with a logical AND
*/
static and(...conditions: Condition[]): Condition;
/**
* Combine two or more conditions with a logical OR
*/
static or(...conditions: Condition[]): Condition;
/**
* Negate a condition
*/
static not(condition: Condition): Condition;
/**
* JSONata expression condition
*/
static jsonata(condition: string): Condition;
/**
* Render Amazon States Language JSON for the condition
*/
abstract renderCondition(): any;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,27 @@
import { EncryptionConfiguration } from './encryption-configuration';
import type * as kms from '../../aws-kms';
import * as cdk from '../../core';
/**
* Define a new CustomerManagedEncryptionConfiguration
*/
export declare class CustomerManagedEncryptionConfiguration extends EncryptionConfiguration {
/**
* The symmetric customer managed KMS key for server-side encryption of the state machine definition, and execution history or activity inputs.
* Step Functions will reuse the key for a maximum of `kmsDataKeyReusePeriodSeconds`.
*
* @default - data is transparently encrypted using an AWS owned key
*/
readonly kmsKey: kms.IKey;
/**
* Maximum duration that Step Functions will reuse customer managed data keys.
* When the period expires, Step Functions will call GenerateDataKey.
*
* Must be between 60 and 900 seconds.
*
* @default Duration.seconds(300)
*/
readonly kmsDataKeyReusePeriodSeconds?: cdk.Duration | undefined;
constructor(kmsKey: kms.IKey, kmsDataKeyReusePeriodSeconds?: cdk.Duration);
private isInvalidKmsDataKeyReusePeriodSeconds;
private validateKmsDataKeyReusePeriodSeconds;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomerManagedEncryptionConfiguration=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var encryption_configuration_1=()=>{var tmp=require("./encryption-configuration");return encryption_configuration_1=()=>tmp,tmp},cdk=()=>{var tmp=require("../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};const CUSTOMER_MANAGED_KMS_KEY="CUSTOMER_MANAGED_KMS_KEY";class CustomerManagedEncryptionConfiguration extends encryption_configuration_1().EncryptionConfiguration{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.CustomerManagedEncryptionConfiguration",version:"2.252.0"};kmsKey;kmsDataKeyReusePeriodSeconds;constructor(kmsKey,kmsDataKeyReusePeriodSeconds){super(CUSTOMER_MANAGED_KMS_KEY);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_kms_IKey(kmsKey),jsiiDeprecationWarnings().aws_cdk_lib_Duration(kmsDataKeyReusePeriodSeconds)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CustomerManagedEncryptionConfiguration),error}this.kmsKey=kmsKey,this.validateKmsDataKeyReusePeriodSeconds(kmsDataKeyReusePeriodSeconds),this.kmsDataKeyReusePeriodSeconds=kmsDataKeyReusePeriodSeconds}isInvalidKmsDataKeyReusePeriodSeconds(kmsDataKeyReusePeriodSeconds){return kmsDataKeyReusePeriodSeconds.toSeconds()<60||kmsDataKeyReusePeriodSeconds.toSeconds()>900}validateKmsDataKeyReusePeriodSeconds(kmsDataKeyReusePeriodSeconds){if(kmsDataKeyReusePeriodSeconds&&this.isInvalidKmsDataKeyReusePeriodSeconds(kmsDataKeyReusePeriodSeconds))throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`InvalidKmsDataKeyReusePeriod`,"kmsDataKeyReusePeriodSeconds must have a value between 60 and 900 seconds")}}exports.CustomerManagedEncryptionConfiguration=CustomerManagedEncryptionConfiguration;

View File

@@ -0,0 +1,10 @@
/**
* Base class for creating an EncryptionConfiguration for either state machines or activities.
*/
export declare abstract class EncryptionConfiguration {
/**
* Encryption option for the state machine or activity. Can be either CUSTOMER_MANAGED_KMS_KEY or AWS_OWNED_KEY.
*/
type: string;
constructor(type: string);
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.EncryptionConfiguration=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class EncryptionConfiguration{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.EncryptionConfiguration",version:"2.252.0"};type;constructor(type){this.type=type}}exports.EncryptionConfiguration=EncryptionConfiguration;

View File

@@ -0,0 +1,301 @@
import type { IResolvable } from '../../core';
/**
* Extract a field from the State Machine data or context
* that gets passed around between states
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-paths.html
*/
export declare class JsonPath {
/**
* Special string value to discard state input, output or result.
*/
static readonly DISCARD: string;
/**
* Instead of using a literal string, get the value from a JSON path
*/
static stringAt(path: string): string;
/**
* Instead of using a literal string list, get the value from a JSON path
*/
static listAt(path: string): string[];
/**
* Instead of using a literal number, get the value from a JSON path
*/
static numberAt(path: string): number;
/**
* Reference a complete (complex) object in a JSON path location
*/
static objectAt(path: string): IResolvable;
/**
* Use the entire data structure
*
* Will be an object at invocation time, but is represented in the CDK
* application as a string.
*/
static get entirePayload(): string;
/**
* Determines if the indicated string is an encoded JSON path
*
* @param value string to be evaluated
*/
static isEncodedJsonPath(value: string): boolean;
/**
* Return the Execution Id field from the context object
*/
static get executionId(): string;
/**
* Return the Execution Input field from the context object
*
* * Will be an object at invocation time, but is represented in the CDK
* application as a string.
*/
static get executionInput(): string;
/**
* Return the Execution Name field from the context object
*/
static get executionName(): string;
/**
* Return the Execution RoleArn field from the context object
*/
static get executionRoleArn(): string;
/**
* Return the Execution StartTime field from the context object
*/
static get executionStartTime(): string;
/**
* Return the State EnteredTime field from the context object
*/
static get stateEnteredTime(): string;
/**
* Return the State Name field from the context object
*/
static get stateName(): string;
/**
* Return the State RetryCount field from the context object
*/
static get stateRetryCount(): string;
/**
* Return the StateMachine Id field from the context object
*/
static get stateMachineId(): string;
/**
* Return the StateMachine Name field from the context object
*/
static get stateMachineName(): string;
/**
* Return the Task Token field from the context object
*
* External actions will need this token to report step completion
* back to StepFunctions using the `SendTaskSuccess` or `SendTaskFailure`
* calls.
*/
static get taskToken(): string;
/**
* Use the entire context data structure
*
* Will be an object at invocation time, but is represented in the CDK
* application as a string.
*/
static get entireContext(): string;
/**
* Make an intrinsic States.Array expression
*
* Combine any number of string literals or JsonPath expressions into an array.
*
* Use this function if the value of an array element directly has to come
* from a JSON Path expression (either the State object or the Context object).
*
* If the array contains object literals whose values come from a JSON path
* expression, you do not need to use this function.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static array(...values: string[]): string;
/**
* Make an intrinsic States.ArrayPartition expression
*
* Use this function to partition a large array. You can also use this intrinsic to slice the data and then send the payload in smaller chunks.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static arrayPartition(array: any, chunkSize: number): string;
/**
* Make an intrinsic States.ArrayContains expression
*
* Use this function to determine if a specific value is present in an array. For example, you can use this function to detect if there was an error in a Map state iteration.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static arrayContains(array: any, value: any): string;
/**
* Make an intrinsic States.ArrayRange expression
*
* Use this function to create a new array containing a specific range of elements. The new array can contain up to 1000 elements.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static arrayRange(start: number, end: number, step: number): string;
/**
* Make an intrinsic States.ArrayGetItem expression
*
* Use this function to get a specified index's value in an array.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static arrayGetItem(array: any, index: number): string;
/**
* Make an intrinsic States.ArrayLength expression
*
* Use this function to get the length of an array.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static arrayLength(array: any): string;
/**
* Make an intrinsic States.ArrayUnique expression
*
* Use this function to get the length of an array.
* Use this function to remove duplicate values from an array and returns an array containing only unique elements. This function takes an array, which can be unsorted, as its sole argument.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static arrayUnique(array: any): string;
/**
* Make an intrinsic States.Base64Encode expression
*
* Use this function to encode data based on MIME Base64 encoding scheme. You can use this function to pass data to other AWS services without using an AWS Lambda function.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static base64Encode(input: string): string;
/**
* Make an intrinsic States.Base64Decode expression
*
* Use this function to decode data based on MIME Base64 decoding scheme. You can use this function to pass data to other AWS services without using a Lambda function.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static base64Decode(base64: string): string;
/**
* Make an intrinsic States.Hash expression
*
* Use this function to calculate the hash value of a given input. You can use this function to pass data to other AWS services without using a Lambda function.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static hash(data: any, algorithm: string): string;
/**
* Make an intrinsic States.JsonMerge expression
*
* Use this function to merge two JSON objects into a single object.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static jsonMerge(value1: any, value2: any): string;
/**
* Make an intrinsic States.MathRandom expression
*
* Use this function to return a random number between the specified start and end number. For example, you can use this function to distribute a specific task between two or more resources.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static mathRandom(start: number, end: number): string;
/**
* Make an intrinsic States.MathAdd expression
*
* Use this function to return the sum of two numbers. For example, you can use this function to increment values inside a loop without invoking a Lambda function.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static mathAdd(num1: number, num2: number): string;
/**
* Make an intrinsic States.StringSplit expression
*
* Use this function to split a string into an array of values. This function takes two arguments.The first argument is a string and the second argument is the delimiting character that the function will use to divide the string.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static stringSplit(inputString: string, splitter: string): string;
/**
* Make an intrinsic States.UUID expression
*
* Use this function to return a version 4 universally unique identifier (v4 UUID) generated using random numbers. For example, you can use this function to call other AWS services or resources that need a UUID parameter or insert items in a DynamoDB table.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static uuid(): string;
/**
* Make an intrinsic States.Format expression
*
* This can be used to embed JSON Path variables inside a format string.
*
* For example:
*
* ```ts
* sfn.JsonPath.format('Hello, my name is {}.', sfn.JsonPath.stringAt('$.name'))
* ```
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static format(formatString: string, ...values: string[]): string;
/**
* Make an intrinsic States.StringToJson expression
*
* During the execution of the Step Functions state machine, parse the given
* argument as JSON into its object form.
*
* For example:
*
* ```ts
* sfn.JsonPath.stringToJson(sfn.JsonPath.stringAt('$.someJsonBody'))
* ```
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static stringToJson(jsonString: string): IResolvable;
/**
* Make an intrinsic States.JsonToString expression
*
* During the execution of the Step Functions state machine, encode the
* given object into a JSON string.
*
* For example:
*
* ```ts
* sfn.JsonPath.jsonToString(sfn.JsonPath.objectAt('$.someObject'))
* ```
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-intrinsic-functions.html
*/
static jsonToString(value: any): string;
private constructor();
}
/**
* Helper functions to work with structures containing fields
*/
export declare class FieldUtils {
/**
* Render a JSON structure containing fields to the right StepFunctions structure
*/
static renderObject(obj?: {
[key: string]: any;
}): {
[key: string]: any;
} | undefined;
/**
* Return all JSON paths used in the given structure
*/
static findReferencedPaths(obj?: {
[key: string]: any;
}): string[];
/**
* Returns whether the given task structure contains the TaskToken field anywhere
*
* The field is considered included if the field itself or one of its containing
* fields occurs anywhere in the payload.
*/
static containsTaskToken(obj?: {
[key: string]: any;
}): boolean;
private constructor();
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,33 @@
export * from './fields';
export * from './activity';
export * from './input';
export * from './types';
export * from './condition';
export * from './state-machine';
export * from './state-machine-grants';
export * from './state-machine-fragment';
export * from './state-transition-metrics';
export * from './chain';
export * from './state-graph';
export * from './step-functions-task';
export * from './states/choice';
export * from './states/fail';
export * from './states/parallel';
export * from './states/pass';
export * from './states/state';
export * from './states/succeed';
import './states/task';
export * from './states/wait';
export * from './states/map';
export * from './states/distributed-map';
export * from './states/distributed-map/item-batcher';
export * from './states/distributed-map/item-reader';
export * from './states/distributed-map/result-writer';
export * from './states/custom-state';
export * from './states/map-base';
export * from './states/task-base';
export * from './task-credentials';
export * from './encryption-configuration';
export * from './customer-managed-key-encryption-configuration';
export * from './aws-owned-key-encryption-configuration';
export * from './stepfunctions.generated';

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,66 @@
/**
* Type union for task classes that accept multiple types of payload
*/
export declare class TaskInput {
readonly type: InputType;
readonly value: any;
/**
* Use a literal string as task input
*
* This might be a JSON-encoded object, or just a text.
*/
static fromText(text: string): TaskInput;
/**
* Use an object as task input
*
* This object may contain JSON path fields as object values, if desired.
*
* Use `sfn.JsonPath.DISCARD` in place of `null` for languages that do not support `null` (i.e. Python).
*/
static fromObject(obj: {
[key: string]: any;
}): TaskInput;
/**
* Use a part of the execution data or task context as task input
*
* Use this when you want to use a subobject or string from
* the current state machine execution or the current task context
* as complete payload to a task.
*/
static fromJsonPathAt(path: string): TaskInput;
/**
*
* @param type type of task input
* @param value payload for the corresponding input type.
* It can be a JSON-encoded object, context, data, etc.
*/
private constructor();
}
/**
* The type of task input
*/
export declare enum InputType {
/**
* Use a literal string
* This might be a JSON-encoded object, or just text.
* valid JSON text: standalone, quote-delimited strings; objects; arrays; numbers; Boolean values; and null.
*
* example: `literal string`
* example: {"json": "encoded"}
*/
TEXT = 0,
/**
* Use an object which may contain Data and Context fields
* as object values, if desired.
*
* example:
* {
* literal: 'literal',
* SomeInput: sfn.JsonPath.stringAt('$.someField')
* }
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-state-machine-data.html
* @see https://docs.aws.amazon.com/step-functions/latest/dg/input-output-contextobject.html
*/
OBJECT = 1
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InputType=exports.TaskInput=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var fields_1=()=>{var tmp=require("./fields");return fields_1=()=>tmp,tmp};class TaskInput{type;value;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.TaskInput",version:"2.252.0"};static fromText(text){return new TaskInput(InputType.TEXT,text)}static fromObject(obj){return new TaskInput(InputType.OBJECT,obj)}static fromJsonPathAt(path){return new TaskInput(InputType.TEXT,fields_1().JsonPath.stringAt(path))}static fromDataAt(path){return new TaskInput(InputType.TEXT,fields_1().JsonPath.stringAt(path))}static fromContextAt(path){return new TaskInput(InputType.TEXT,fields_1().JsonPath.stringAt(path))}constructor(type,value){this.type=type,this.value=value}}exports.TaskInput=TaskInput;var InputType;(function(InputType2){InputType2[InputType2.TEXT=0]="TEXT",InputType2[InputType2.OBJECT=1]="OBJECT"})(InputType||(exports.InputType=InputType={}));

View File

@@ -0,0 +1,86 @@
export type IntrinsicExpression = StringLiteralExpression | PathExpression | FnCallExpression;
export type TopLevelIntrinsic = PathExpression | FnCallExpression;
export interface StringLiteralExpression {
readonly type: 'string-literal';
readonly literal: string;
}
export interface PathExpression {
readonly type: 'path';
readonly path: string;
}
export interface FnCallExpression {
readonly type: 'fncall';
readonly functionName: string;
readonly arguments: IntrinsicExpression[];
}
/**
* LL(1) parser for StepFunctions intrinsics
*
* The parser implements a state machine over a cursor into an expression
* string. The cusor gets moved, the character at the cursor gets inspected
* and based on the character we accumulate some value and potentially move
* to a different state.
*
* Literal strings are not allowed at the top level, but are allowed inside
* function calls.
*/
export declare class IntrinsicParser {
private readonly expression;
private i;
constructor(expression: string);
parseTopLevelIntrinsic(): TopLevelIntrinsic;
private parseIntrinsic;
/**
* Simplified path parsing
*
* JSON path can actually be quite complicated, but we don't need to validate
* it precisely. We just need to know how far it extends.
*
* Therefore, we only care about:
*
* - Starts with a $
* - Accept ., $ and alphanums
* - Accept single-quoted strings ('...')
* - Accept anything between matched square brackets ([...])
*/
private parsePath;
/**
* Parse a fncall
*
* Cursor should be on call identifier. Afterwards, cursor will be on closing
* quote.
*/
private parseFnCall;
/**
* Parse a string literal
*
* Cursor is expected to be on the first opening quote. Afterwards,
* cursor will be after the closing quote.
*/
private parseStringLiteral;
/**
* Parse a bracketed expression
*
* Cursor is expected to be on the opening brace. Afterwards,
* the cursor will be after the closing brace.
*/
private consumeBracketedExpression;
/**
* Parse a string literal
*
* Cursor is expected to be on the first opening quote. Afterwards,
* cursor will be after the closing quote.
*/
private consumeQuotedString;
/**
* Consume whitespace if it exists
*
* Move the cursor to the next non-whitespace character.
*/
private ws;
private get eof();
private char;
private next;
private consume;
private raiseError;
}

View File

@@ -0,0 +1,2 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.IntrinsicParser=void 0;var core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp};class IntrinsicParser{expression;i=0;constructor(expression){this.expression=expression}parseTopLevelIntrinsic(){this.ws();let ret;return this.char()==="$"?ret=this.parsePath():isAlphaNum(this.char())?ret=this.parseFnCall():this.raiseError("expected '$' or a function call"),this.ws(),this.eof||this.raiseError("unexpected trailing characters"),ret}parseIntrinsic(){if(this.ws(),this.char()==="$")return this.parsePath();if(isAlphaNum(this.char()))return this.parseFnCall();if(this.char()==="'")return this.parseStringLiteral();this.raiseError("expected $, function or single-quoted string")}parsePath(){const pathString=new Array;this.char()!=="$"&&this.raiseError("expected '$'"),pathString.push(this.consume());let done=!1;for(;!done&&!this.eof;)switch(this.char()){case".":case"$":pathString.push(this.consume());break;case"'":const{quoted}=this.consumeQuotedString();pathString.push(quoted);break;case"[":pathString.push(this.consumeBracketedExpression("]"));break;default:if(isAlphaNum(this.char())){pathString.push(this.consume());break}done=!0}return{type:"path",path:pathString.join("")}}parseFnCall(){const name=new Array;for(;this.char()!=="(";)name.push(this.consume());this.next(),this.ws();const args=[];for(;this.char()!==")";)if(args.push(this.parseIntrinsic()),this.ws(),this.char()===","){this.next();continue}else{if(this.char()===")")continue;this.raiseError("expected , or )")}return this.next(),{type:"fncall",arguments:args,functionName:name.join("")}}parseStringLiteral(){const{unquoted}=this.consumeQuotedString();return{type:"string-literal",literal:unquoted}}consumeBracketedExpression(closingBrace){const ret=new Array;for(ret.push(this.consume());this.char()!==closingBrace;)this.char()==="["?ret.push(this.consumeBracketedExpression("]")):this.char()==="{"?ret.push(this.consumeBracketedExpression("}")):ret.push(this.consume());return ret.push(this.consume()),ret.join("")}consumeQuotedString(){const quoted=new Array,unquoted=new Array;for(quoted.push(this.consume());this.char()!=="'";)this.char()==="\\"&&quoted.push(this.consume()),quoted.push(this.char()),unquoted.push(this.char()),this.next();return quoted.push(this.consume()),{quoted:quoted.join(""),unquoted:unquoted.join("")}}ws(){for(;!this.eof&&[" "," ",`
`].includes(this.char());)this.next()}get eof(){return this.i>=this.expression.length}char(){return this.eof&&this.raiseError("unexpected end of string"),this.expression[this.i]}next(){this.i++}consume(){const ret=this.char();return this.next(),ret}raiseError(message){throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`InvalidJsonPathExpression`,`Invalid JSONPath expression: ${message} at index ${this.i} in ${JSON.stringify(this.expression)}`)}}exports.IntrinsicParser=IntrinsicParser;function isAlphaNum(x){return x.match(/^[a-zA-Z0-9]$/)}

View File

@@ -0,0 +1,57 @@
import type { IResolvable, IResolveContext } from '../../../core';
export declare class JsonPathToken implements IResolvable {
readonly path: string;
static isJsonPathToken(this: void, x: IResolvable): x is JsonPathToken;
readonly creationStack: string[];
displayHint: string;
constructor(path: string);
resolve(_ctx: IResolveContext): string;
toString(): string;
toJSON(): string;
}
/**
* Deep render a JSON object to expand JSON path fields, updating the key to end in '.$'
*/
export declare function renderObject(obj: object | undefined): object | undefined;
/**
* Return all JSON paths that are used in the given structure
*/
export declare function findReferencedPaths(obj: object | undefined): Set<string>;
interface FieldHandlers {
handleString(key: string, x: string): {
[key: string]: string;
};
handleList(key: string, x: string[]): {
[key: string]: string[] | string;
};
handleNumber(key: string, x: number): {
[key: string]: number | string;
};
handleBoolean(key: string, x: boolean): {
[key: string]: boolean;
};
handleResolvable(key: string, x: IResolvable): {
[key: string]: any;
};
}
export declare function recurseObject(obj: object | undefined, handlers: FieldHandlers, visited?: object[]): object | undefined;
/**
* If the indicated string is an encoded JSON path, return the path
*
* Otherwise return undefined.
*/
export declare function jsonPathString(x: string): string | undefined;
export declare function jsonPathFromAny(x: any): string | undefined;
/**
* Render the string or number value in a valid JSON Path expression.
*
* If the value is a Tokenized JSON path reference -- return the JSON path reference inside it.
* If the value is a number -- convert it to string.
* If the value is a string -- single-quote it.
* Otherwise, throw errors.
*
* Call this function whenever you're building compound JSONPath expressions, in
* order to avoid having tokens-in-tokens-in-tokens which become very hard to parse.
*/
export declare function renderInExpression(x: any): string;
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
export declare const isValidJsonataExpression: (expression: string) => boolean;
export declare const findJsonataExpressions: (value: any) => Set<string>;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.findJsonataExpressions=exports.isValidJsonataExpression=void 0;const isValidJsonataExpression=expression=>/^{%(.*)%}$/s.test(expression);exports.isValidJsonataExpression=isValidJsonataExpression;const findJsonataExpressions=value=>{const recursive=v=>typeof v=="string"&&(0,exports.isValidJsonataExpression)(v)?[v]:v===null?[]:Array.isArray(v)?v.flatMap(recursive):typeof v=="object"?Object.values(v).flatMap(recursive):[];return new Set(recursive(value))};exports.findJsonataExpressions=findJsonataExpressions;

View File

@@ -0,0 +1,11 @@
import type { EncryptionConfiguration } from '../encryption-configuration';
export declare function noEmptyObject<A>(o: Record<string, A>): Record<string, A> | undefined;
export declare function buildEncryptionConfiguration(encryptionConfiguration?: EncryptionConfiguration): {
type: string;
kmsKeyId?: undefined;
kmsDataKeyReusePeriodSeconds?: undefined;
} | {
kmsKeyId: string;
kmsDataKeyReusePeriodSeconds: number;
type: string;
} | undefined;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.noEmptyObject=noEmptyObject,exports.buildEncryptionConfiguration=buildEncryptionConfiguration;var aws_owned_key_encryption_configuration_1=()=>{var tmp=require("../aws-owned-key-encryption-configuration");return aws_owned_key_encryption_configuration_1=()=>tmp,tmp},customer_managed_key_encryption_configuration_1=()=>{var tmp=require("../customer-managed-key-encryption-configuration");return customer_managed_key_encryption_configuration_1=()=>tmp,tmp};function noEmptyObject(o){if(Object.keys(o).length!==0)return o}function buildEncryptionConfiguration(encryptionConfiguration){if(encryptionConfiguration instanceof aws_owned_key_encryption_configuration_1().AwsOwnedEncryptionConfiguration)return{type:encryptionConfiguration.type};if(encryptionConfiguration instanceof customer_managed_key_encryption_configuration_1().CustomerManagedEncryptionConfiguration)return{kmsKeyId:encryptionConfiguration.kmsKey.keyArn,kmsDataKeyReusePeriodSeconds:encryptionConfiguration.kmsDataKeyReusePeriodSeconds?encryptionConfiguration.kmsDataKeyReusePeriodSeconds.toSeconds():300,type:encryptionConfiguration.type}}

View File

@@ -0,0 +1,109 @@
import type { StateMachine } from './state-machine';
import type { State } from './states/state';
import type { QueryLanguage } from './types';
import * as iam from '../../aws-iam';
import type { Duration } from '../../core';
/**
* A collection of connected states
*
* A StateGraph is used to keep track of all states that are connected (have
* transitions between them). It does not include the substatemachines in
* a Parallel's branches: those are their own StateGraphs, but the graphs
* themselves have a hierarchical relationship as well.
*
* By assigning states to a definitive StateGraph, we verify that no state
* machines are constructed. In particular:
*
* - Every state object can only ever be in 1 StateGraph, and not inadvertently
* be used in two graphs.
* - Every stateId must be unique across all states in the entire state
* machine.
*
* All policy statements in all states in all substatemachines are bubbled so
* that the top-level StateMachine instantiation can read them all and add
* them to the IAM Role.
*
* You do not need to instantiate this class; it is used internally.
*/
export declare class StateGraph {
readonly startState: State;
private readonly graphDescription;
/**
* Set a timeout to render into the graph JSON.
*
* Read/write. Only makes sense on the top-level graph, subgraphs
* do not support this feature.
*
* @default No timeout
*/
timeout?: Duration;
/**
* The accumulated policy statements
*/
readonly policyStatements: iam.PolicyStatement[];
/**
* All states in this graph
*/
private readonly allStates;
/**
* A mapping of stateId -> Graph for all states in this graph and subgraphs
*/
private readonly allContainedStates;
/**
* Containing graph of this graph
*/
private superGraph?;
/**
* @param startState state that gets executed when the state machine is launched
* @param graphDescription description of the state machine
*/
constructor(startState: State, graphDescription: string);
/**
* Register a state as part of this graph
*
* Called by State.bindToGraph().
*/
registerState(state: State): void;
/**
* Register a Policy Statement used by states in this graph
*/
registerPolicyStatement(statement: iam.PolicyStatement): void;
/**
* Register this graph as a child of the given graph
*
* Resource changes will be bubbled up to the given graph.
*/
registerSuperGraph(graph: StateGraph): void;
/**
* Return the Amazon States Language JSON for this graph
*/
toGraphJson(queryLanguage?: QueryLanguage): object;
/**
* Return a string description of this graph
*/
toString(): string;
/**
* Register a stateId and graph where it was registered
*/
private registerContainedState;
/**
* Push all contained state info up to the given super graph
*/
private pushContainedStatesUp;
/**
* Push all policy statements to into the given super graph
*/
private pushPolicyStatementsUp;
/**
* Binds this StateGraph to the StateMachine it defines and updates state machine permissions if there are DistributedMap states.
*/
bind(stateMachine: StateMachine): void;
/**
* Helper method for returning executionArn with mapRunLabel
*/
private getStateMachineExecutionArnWithLabel;
/**
* Returns all the states referenced in this StateGraph and all child StateGraphs
*/
private getAllStatesInThisAndChildStateGraphs;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,62 @@
import { Construct } from 'constructs';
import { Chain } from './chain';
import type { ParallelProps } from './states/parallel';
import { Parallel } from './states/parallel';
import { State } from './states/state';
import type { IChainable, INextable } from './types';
/**
* Base class for reusable state machine fragments
*/
export declare abstract class StateMachineFragment extends Construct implements IChainable {
/**
* The start state of this state machine fragment
*/
abstract readonly startState: State;
/**
* The states to chain onto if this fragment is used
*/
abstract readonly endStates: INextable[];
get id(): string;
/**
* Prefix the IDs of all states in this state machine fragment
*
* Use this to avoid multiple copies of the state machine all having the
* same state IDs.
*
* @param prefix The prefix to add. Will use construct ID by default.
*/
prefixStates(prefix?: string): StateMachineFragment;
/**
* Wrap all states in this state machine fragment up into a single state.
*
* This can be used to add retry or error handling onto this state
* machine fragment.
*
* Be aware that this changes the result of the inner state machine
* to be an array with the result of the state machine in it. Adjust
* your paths accordingly. For example, change 'outputPath' to
* '$[0]'.
*/
toSingleState(options?: SingleStateOptions): Parallel;
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
}
/**
* Options for creating a single state
*/
export interface SingleStateOptions extends ParallelProps {
/**
* ID of newly created containing state
*
* @default Construct ID of the StateMachineFragment
*/
readonly stateId?: string;
/**
* String to prefix all stateIds in the state machine with
*
* @default stateId
*/
readonly prefixStates?: string;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StateMachineFragment=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var constructs_1=()=>{var tmp=require("constructs");return constructs_1=()=>tmp,tmp},chain_1=()=>{var tmp=require("./chain");return chain_1=()=>tmp,tmp},parallel_1=()=>{var tmp=require("./states/parallel");return parallel_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./states/state");return state_1=()=>tmp,tmp};class StateMachineFragment extends constructs_1().Construct{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.StateMachineFragment",version:"2.252.0"};get id(){return this.node.id}prefixStates(prefix){return state_1().State.prefixStates(this,prefix||`${this.id}: `),this}toSingleState(options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_SingleStateOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toSingleState),error}const stateId=options.stateId||this.id;return this.prefixStates(options.prefixStates||`${stateId}: `),new(parallel_1()).Parallel(this,stateId,options).branch(this)}next(next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}return chain_1().Chain.start(this).next(next)}}exports.StateMachineFragment=StateMachineFragment;

View File

@@ -0,0 +1,64 @@
import * as stepfunctions from './stepfunctions.generated';
import * as iam from '../../aws-iam';
/**
* Properties for StateMachineGrants
*/
export interface StateMachineGrantsProps {
/**
* The resource on which actions will be allowed
*/
readonly resource: stepfunctions.IStateMachineRef;
}
/**
* Collection of grant methods for a IStateMachineRef
*/
export declare class StateMachineGrants {
/**
* Creates grants for StateMachineGrants
*/
static fromStateMachine(resource: stepfunctions.IStateMachineRef): StateMachineGrants;
protected readonly resource: stepfunctions.IStateMachineRef;
private constructor();
/**
* Grant the given identity task response permissions on a state machine
*/
taskResponse(grantee: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permission to redrive the execution of the state machine
*/
redriveExecution(grantee: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to read results from state
* machine.
*/
read(grantee: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to start an execution of this state
* machine.
*
* @param grantee The principal
*/
startExecution(grantee: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to start a synchronous execution of
* this state machine.
*
* @param grantee The principal
*/
startSyncExecution(grantee: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to start an execution of
* this state machine.
*
* @param grantee The principal
*/
execution(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant the given identity custom permissions
*/
actions(identity: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Returns the pattern for the execution ARN's of the state machine
*/
private executionArn;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StateMachineGrants=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var stepfunctions=()=>{var tmp=require("./stepfunctions.generated");return stepfunctions=()=>tmp,tmp},iam=()=>{var tmp=require("../../aws-iam");return iam=()=>tmp,tmp},core_1=()=>{var tmp=require("../../core");return core_1=()=>tmp,tmp};class StateMachineGrants{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.StateMachineGrants",version:"2.252.0"};static fromStateMachine(resource){try{jsiiDeprecationWarnings().aws_cdk_lib_interfaces_aws_stepfunctions_IStateMachineRef(resource)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromStateMachine),error}return new StateMachineGrants({resource})}resource;constructor(props){this.resource=props.resource}taskResponse(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.taskResponse),error}const actions=["states:SendTaskSuccess","states:SendTaskFailure","states:SendTaskHeartbeat"];return iam().Grant.addToPrincipal({actions,grantee,resourceArns:[stepfunctions().CfnStateMachine.arnForStateMachine(this.resource)]})}redriveExecution(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.redriveExecution),error}const actions=["states:RedriveExecution"];return iam().Grant.addToPrincipal({actions,grantee,resourceArns:[stepfunctions().CfnStateMachine.arnForStateMachine(this.resource)+":*"]})}read(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.read),error}return iam().Grant.addToPrincipal({grantee,actions:["states:ListExecutions","states:ListStateMachines"],resourceArns:[stepfunctions().CfnStateMachine.arnForStateMachine(this.resource)]}),iam().Grant.addToPrincipal({grantee,actions:["states:DescribeExecution","states:DescribeStateMachineForExecution","states:GetExecutionHistory"],resourceArns:[this.executionArn()+":*"]}),iam().Grant.addToPrincipal({grantee,actions:["states:ListActivities","states:DescribeStateMachine","states:DescribeActivity"],resourceArns:["*"]})}startExecution(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.startExecution),error}return iam().Grant.addToPrincipal({grantee,actions:["states:StartExecution"],resourceArns:[this.resource.stateMachineRef.stateMachineArn]})}startSyncExecution(grantee){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.startSyncExecution),error}return iam().Grant.addToPrincipal({grantee,actions:["states:StartSyncExecution"],resourceArns:[this.resource.stateMachineRef.stateMachineArn]})}execution(grantee,...actions){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(grantee)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.execution),error}return iam().Grant.addToPrincipal({grantee,actions,resourceArns:[this.executionArn()+":*"]})}actions(identity,...actions){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IGrantable(identity)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.actions),error}return iam().Grant.addToPrincipal({grantee:identity,actions,resourceArns:[this.resource.stateMachineRef.stateMachineArn]})}executionArn(){return core_1().Stack.of(this.resource).formatArn({resource:"execution",service:"states",resourceName:core_1().Arn.split(this.resource.stateMachineRef.stateMachineArn,core_1().ArnFormat.COLON_RESOURCE_NAME).resourceName,arnFormat:core_1().ArnFormat.COLON_RESOURCE_NAME})}}exports.StateMachineGrants=StateMachineGrants;

View File

@@ -0,0 +1,473 @@
import type { Construct } from 'constructs';
import type { EncryptionConfiguration } from './encryption-configuration';
import { StateGraph } from './state-graph';
import { StateMachineGrants } from './state-machine-grants';
import type { IStateMachineRef, StateMachineReference } from './stepfunctions.generated';
import { CfnStateMachine } from './stepfunctions.generated';
import type { IChainable, QueryLanguage } from './types';
import * as cloudwatch from '../../aws-cloudwatch';
import * as iam from '../../aws-iam';
import type * as logs from '../../aws-logs';
import * as s3_assets from '../../aws-s3-assets';
import type { Duration, IResource } from '../../core';
import { RemovalPolicy, Resource } from '../../core';
/**
* Two types of state machines are available in AWS Step Functions: EXPRESS AND STANDARD.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-standard-vs-express.html
*
* @default STANDARD
*/
export declare enum StateMachineType {
/**
* Express Workflows are ideal for high-volume, event processing workloads.
*/
EXPRESS = "EXPRESS",
/**
* Standard Workflows are ideal for long-running, durable, and auditable workflows.
*/
STANDARD = "STANDARD"
}
/**
* Defines which category of execution history events are logged.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html
*
* @default ERROR
*/
export declare enum LogLevel {
/**
* No Logging
*/
OFF = "OFF",
/**
* Log everything
*/
ALL = "ALL",
/**
* Log all errors
*/
ERROR = "ERROR",
/**
* Log fatal errors
*/
FATAL = "FATAL"
}
/**
* Defines what execution history events are logged and where they are logged.
*/
export interface LogOptions {
/**
* The log group where the execution history events will be logged.
*
* @default No log group. Required if your log level is not set to OFF.
*/
readonly destination?: logs.ILogGroupRef;
/**
* Determines whether execution data is included in your log.
*
* @default false
*/
readonly includeExecutionData?: boolean;
/**
* Defines which category of execution history events are logged.
*
* @default ERROR
*/
readonly level?: LogLevel;
}
/**
* Properties for defining a State Machine
*/
export interface StateMachineProps {
/**
* A name for the state machine
*
* @default A name is automatically generated
*/
readonly stateMachineName?: string;
/**
* Definition for this state machine
* @deprecated use definitionBody: DefinitionBody.fromChainable()
*/
readonly definition?: IChainable;
/**
* Definition for this state machine
*/
readonly definitionBody?: DefinitionBody;
/**
* substitutions for the definition body as a key-value map
*/
readonly definitionSubstitutions?: {
[key: string]: string;
};
/**
* The execution role for the state machine service
*
* @default A role is automatically created
*/
readonly role?: iam.IRole;
/**
* Maximum run time for this state machine
*
* @default No timeout
*/
readonly timeout?: Duration;
/**
* Comment that describes this state machine
*
* @default - No comment
*/
readonly comment?: string;
/**
* The name of the query language used by the state machine.
* If the state does not contain a `queryLanguage` field,
* then it will use the query language specified in this `queryLanguage` field.
*
* @default - JSON_PATH
*/
readonly queryLanguage?: QueryLanguage;
/**
* Type of the state machine
*
* @default StateMachineType.STANDARD
*/
readonly stateMachineType?: StateMachineType;
/**
* Defines what execution history events are logged and where they are logged.
*
* @default No logging
*/
readonly logs?: LogOptions;
/**
* Specifies whether Amazon X-Ray tracing is enabled for this state machine.
*
* @default false
*/
readonly tracingEnabled?: boolean;
/**
* The removal policy to apply to state machine
*
* @default RemovalPolicy.DESTROY
*/
readonly removalPolicy?: RemovalPolicy;
/**
* Configures server-side encryption of the state machine definition and execution history.
*
* @default - data is transparently encrypted using an AWS owned key
*/
readonly encryptionConfiguration?: EncryptionConfiguration;
}
/**
* A new or imported state machine.
*/
declare abstract class StateMachineBase extends Resource implements IStateMachine {
/**
* Import a state machine
*/
static fromStateMachineArn(scope: Construct, id: string, stateMachineArn: string): IStateMachine;
/**
* Import a state machine via resource name
*/
static fromStateMachineName(scope: Construct, id: string, stateMachineName: string): IStateMachine;
abstract readonly stateMachineArn: string;
/**
* The principal this state machine is running as
*/
abstract readonly grantPrincipal: iam.IPrincipal;
/**
* Collection of grant methods for a StateMachine
*/
grants: StateMachineGrants;
get stateMachineRef(): StateMachineReference;
/**
* Grant the given identity permissions to start an execution of this state
* machine.
*
*
* The use of this method is discouraged. Please use `grants.startExecution()` instead.
*
* [disable-awslint:no-grants]
*/
grantStartExecution(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to start a synchronous execution of
* this state machine.
*
*
* The use of this method is discouraged. Please use `grants.startSyncExecution()` instead.
*
* [disable-awslint:no-grants]
*/
grantStartSyncExecution(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to read results from state
* machine.
*
* The use of this method is discouraged. Please use `grants.read()` instead.
*
* [disable-awslint:no-grants]
*/
grantRead(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity task response permissions on a state machine
*
* The use of this method is discouraged. Please use `grants.taskResponse()` instead.
*
* [disable-awslint:no-grants]
*/
grantTaskResponse(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions on all executions of the state machine
*
* The use of this method is discouraged. Please use `grants.execution()` instead.
*
* [disable-awslint:no-grants]
*/
grantExecution(identity: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant the given identity permission to redrive the execution of the state machine
*
*
* The use of this method is discouraged. Please use `grants.redriveExecution()` instead.
*
* [disable-awslint:no-grants]
*/
grantRedriveExecution(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity custom permissions
*
* [disable-awslint:no-grants]
*/
grant(identity: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Return the given named metric for this State Machine's executions
*
* @default - sum over 5 minutes
*/
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that failed
*
* @default - sum over 5 minutes
*/
metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that were throttled
*
* @default - sum over 5 minutes
*/
metricThrottled(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that were aborted
*
* @default - sum over 5 minutes
*/
metricAborted(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that succeeded
*
* @default - sum over 5 minutes
*/
metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that timed out
*
* @default - sum over 5 minutes
*/
metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that were started
*
* @default - sum over 5 minutes
*/
metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the interval, in milliseconds, between the time the execution starts and the time it closes
*
* @default - average over 5 minutes
*/
metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
private cannedMetric;
}
/**
* Define a StepFunctions State Machine
*/
export declare class StateMachine extends StateMachineBase {
/**
* Uniquely identifies this class.
*/
static readonly PROPERTY_INJECTION_ID: string;
/**
* Execution role of this state machine
*/
readonly role: iam.IRole;
/**
* The name of the state machine
* @attribute
*/
get stateMachineName(): string;
/**
* The ARN of the state machine
*/
get stateMachineArn(): string;
/**
* Type of the state machine
* @attribute
*/
readonly stateMachineType: StateMachineType;
/**
* Identifier for the state machine revision, which is an immutable, read-only snapshot of a state machines definition and configuration.
* @attribute
*/
readonly stateMachineRevisionId: string;
private readonly resource;
constructor(scope: Construct, id: string, props: StateMachineProps);
/**
* The principal this state machine is running as
*/
get grantPrincipal(): iam.IPrincipal;
/**
* Add the given statement to the role's policy
*/
addToRolePolicy(statement: iam.PolicyStatement): void;
private validateStateMachineName;
private validateLogOptions;
private buildLoggingConfiguration;
private buildTracingConfiguration;
}
/**
* A State Machine
*/
export interface IStateMachine extends IResource, iam.IGrantable, IStateMachineRef {
/**
* The ARN of the state machine
* @attribute
*/
readonly stateMachineArn: string;
/**
* Grant the given identity permissions to start an execution of this state
* machine.
*
* @param identity The principal
*/
grantStartExecution(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions to start a synchronous execution of
* this state machine.
*
* @param identity The principal
*/
grantStartSyncExecution(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity read permissions for this state machine
*
* @param identity The principal
*/
grantRead(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity read permissions for this state machine
*
* @param identity The principal
*/
grantTaskResponse(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity permissions for all executions of a state machine
*
* @param identity The principal
* @param actions The list of desired actions
*/
grantExecution(identity: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Grant the given identity permission to redrive the execution of the state machine
*
* @param identity The principal
*/
grantRedriveExecution(identity: iam.IGrantable): iam.Grant;
/**
* Grant the given identity custom permissions
*
* @param identity The principal
* @param actions The list of desired actions
*/
grant(identity: iam.IGrantable, ...actions: string[]): iam.Grant;
/**
* Return the given named metric for this State Machine's executions
*
* @default - sum over 5 minutes
*/
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that failed
*
* @default - sum over 5 minutes
*/
metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that were throttled
*
* @default sum over 5 minutes
*/
metricThrottled(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that were aborted
*
* @default - sum over 5 minutes
*/
metricAborted(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that succeeded
*
* @default - sum over 5 minutes
*/
metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that timed out
*
* @default - sum over 5 minutes
*/
metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of executions that were started
*
* @default - sum over 5 minutes
*/
metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the interval, in milliseconds, between the time the execution starts and the time it closes
*
* @default - sum over 5 minutes
*/
metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
}
/**
* Partial object from the StateMachine L1 construct properties containing definition information
*/
export interface DefinitionConfig {
readonly definition?: any;
readonly definitionString?: string;
readonly definitionS3Location?: CfnStateMachine.S3LocationProperty;
}
export declare abstract class DefinitionBody {
static fromFile(path: string, options?: s3_assets.AssetOptions): DefinitionBody;
static fromString(definition: string): DefinitionBody;
static fromChainable(chainable: IChainable): DefinitionBody;
abstract bind(scope: Construct, sfnPrincipal: iam.IPrincipal, sfnProps: StateMachineProps, graph?: StateGraph): DefinitionConfig;
}
export declare class FileDefinitionBody extends DefinitionBody {
readonly path: string;
private readonly options;
constructor(path: string, options?: s3_assets.AssetOptions);
bind(scope: Construct, _sfnPrincipal: iam.IPrincipal, _sfnProps: StateMachineProps, _graph?: StateGraph): DefinitionConfig;
}
export declare class StringDefinitionBody extends DefinitionBody {
readonly body: string;
constructor(body: string);
bind(_scope: Construct, _sfnPrincipal: iam.IPrincipal, _sfnProps: StateMachineProps, _graph?: StateGraph): DefinitionConfig;
}
export declare class ChainDefinitionBody extends DefinitionBody {
readonly chainable: IChainable;
constructor(chainable: IChainable);
bind(scope: Construct, _sfnPrincipal: iam.IPrincipal, sfnProps: StateMachineProps, graph?: StateGraph): DefinitionConfig;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,38 @@
import * as cloudwatch from '../../aws-cloudwatch';
/**
* Metrics on the rate limiting performed on state machine execution.
*
* These rate limits are shared across all state machines.
*/
export declare class StateTransitionMetric {
/**
* Return the given named metric for the service's state transition metrics
*
* @default average over 5 minutes
*/
static metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of available state transitions.
*
* @default average over 5 minutes
*/
static metricProvisionedBucketSize(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the provisioned steady-state execution rate
*
* @default average over 5 minutes
*/
static metricProvisionedRefillRate(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of available state transitions per second
*
* @default average over 5 minutes
*/
static metricConsumedCapacity(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of throttled state transitions
*
* @default sum over 5 minutes
*/
static metricThrottledEvents(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StateTransitionMetric=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var cloudwatch=()=>{var tmp=require("../../aws-cloudwatch");return cloudwatch=()=>tmp,tmp};class StateTransitionMetric{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.StateTransitionMetric",version:"2.252.0"};static metric(metricName,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metric),error}return new(cloudwatch()).Metric({namespace:"AWS/States",metricName,dimensionsMap:{ServiceMetric:"StateTransition"},...props})}static metricProvisionedBucketSize(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricProvisionedBucketSize),error}return StateTransitionMetric.metric("ProvisionedBucketSize",props)}static metricProvisionedRefillRate(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricProvisionedRefillRate),error}return StateTransitionMetric.metric("ProvisionedRefillRate",props)}static metricConsumedCapacity(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricConsumedCapacity),error}return StateTransitionMetric.metric("ConsumedCapacity",props)}static metricThrottledEvents(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_cloudwatch_MetricOptions(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.metricThrottledEvents),error}return StateTransitionMetric.metric("ThrottledEvents",{statistic:"sum",...props})}}exports.StateTransitionMetric=StateTransitionMetric;

View File

@@ -0,0 +1,90 @@
import type { Construct } from 'constructs';
import type { AssignableStateOptions, ChoiceTransitionOptions, JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import { Chain } from '../chain';
import type { Condition } from '../condition';
import type { IChainable, INextable } from '../types';
import { QueryLanguage } from '../types';
/**
* Properties for defining a Choice state that using JSONPath
*/
export interface ChoiceJsonPathProps extends StateBaseProps, AssignableStateOptions, JsonPathCommonOptions {
}
/**
* Properties for defining a Choice state that using JSONata
*/
export interface ChoiceJsonataProps extends StateBaseProps, AssignableStateOptions, JsonataCommonOptions {
}
/**
* Properties for defining a Choice state
*/
export interface ChoiceProps extends StateBaseProps, AssignableStateOptions, JsonPathCommonOptions, JsonataCommonOptions {
}
/**
* Define a Choice in the state machine
*
* A choice state can be used to make decisions based on the execution
* state.
*/
export declare class Choice extends State {
/**
* Define a Choice using JSONPath in the state machine
*
* A choice state can be used to make decisions based on the execution
* state.
*/
static jsonPath(scope: Construct, id: string, props?: ChoiceJsonPathProps): Choice;
/**
* Define a Choice using JSONata in the state machine
*
* A choice state can be used to make decisions based on the execution
* state.
*/
static jsonata(scope: Construct, id: string, props?: ChoiceJsonataProps): Choice;
readonly endStates: INextable[];
constructor(scope: Construct, id: string, props?: ChoiceProps);
/**
* If the given condition matches, continue execution with the given state
*/
when(condition: Condition, next: IChainable, options?: ChoiceTransitionOptions): Choice;
/**
* If none of the given conditions match, continue execution with the given state
*
* If no conditions match and no otherwise() has been given, an execution
* error will be raised.
*/
otherwise(def: IChainable): Choice;
/**
* Return a Chain that contains all reachable end states from this Choice
*
* Use this to combine all possible choice paths back.
*/
afterwards(options?: AfterwardsOptions): Chain;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(topLevelQueryLanguage?: QueryLanguage): object;
}
/**
* Options for selecting the choice paths
*/
export interface AfterwardsOptions {
/**
* Whether to include error handling states
*
* If this is true, all states which are error handlers (added through 'onError')
* and states reachable via error handlers will be included as well.
*
* @default false
*/
readonly includeErrorHandlers?: boolean;
/**
* Whether to include the default/otherwise transition for the current Choice state
*
* If this is true and the current Choice does not have a default outgoing
* transition, one will be added included when .next() is called on the chain.
*
* @default false
*/
readonly includeOtherwise?: boolean;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Choice=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},chain_1=()=>{var tmp=require("../chain");return chain_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class Choice extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Choice",version:"2.252.0"};static jsonPath(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ChoiceJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Choice(scope,id,props)}static jsonata(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ChoiceJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Choice(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}endStates=[];constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ChoiceProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Choice),error}}when(condition,next,options){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_Condition(condition),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ChoiceTransitionOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.when),error}return super.addChoice(condition,next.startState,options),this}otherwise(def){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(def)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.otherwise),error}return super.makeDefault(def.startState),this}afterwards(options={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_AfterwardsOptions(options)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.afterwards),error}const endStates=state_1().State.filterNextables(state_1().State.findReachableEndStates(this,{includeErrorHandlers:options.includeErrorHandlers}));if(options.includeOtherwise&&this.defaultChoice)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ChoiceStateAlreadyHasOtherwise`,`'includeOtherwise' set but Choice state ${this.stateId} already has an 'otherwise' transition`);return options.includeOtherwise&&endStates.push(new DefaultAsNext(this)),chain_1().Chain.custom(this,endStates,this)}toStateJson(topLevelQueryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(topLevelQueryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{Type:state_type_1().StateType.CHOICE,...this.renderQueryLanguage(topLevelQueryLanguage),Comment:this.comment,...this.renderInputOutput(),...this.renderChoices(),...this.renderAssign(topLevelQueryLanguage)}}}exports.Choice=Choice;class DefaultAsNext{choice;constructor(choice){this.choice=choice}next(state){return this.choice.otherwise(state),chain_1().Chain.sequence(this.choice,state)}}

View File

@@ -0,0 +1,55 @@
import type { Construct } from 'constructs';
import { Chain } from '..';
import { State } from './state';
import type { CatchProps, IChainable, INextable, QueryLanguage, RetryProps } from '../types';
/**
* Properties for defining a custom state definition
*/
export interface CustomStateProps {
/**
* Amazon States Language (JSON-based) definition of the state
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html
*/
readonly stateJson: {
[key: string]: any;
};
}
/**
* State defined by supplying Amazon States Language (ASL) in the state machine.
*
*/
export declare class CustomState extends State implements IChainable, INextable {
readonly endStates: INextable[];
/**
* Amazon States Language (JSON-based) definition of the state
*/
private readonly stateJson;
constructor(scope: Construct, id: string, props: CustomStateProps);
/**
* Add retry configuration for this state
*
* This controls if and how the execution will be retried if a particular
* error occurs.
*/
addRetry(props?: RetryProps): CustomState;
/**
* Add a recovery handler for this state
*
* When a particular error occurs, execution will continue at the error
* handler instead of failing the state machine execution.
*/
addCatch(handler: IChainable, props?: CatchProps): CustomState;
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Returns the Amazon States Language object for this state
*/
toStateJson(queryLanguage?: QueryLanguage): object;
private hasMultipleRetrySources;
private hasMultipleCatchSources;
private addMultipleRetrySourcesWarning;
private addMultipleCatchSourcesWarning;
}

View File

@@ -0,0 +1,3 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomState=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var __1=()=>{var tmp=require("..");return __1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core/");return core_1=()=>tmp,tmp};class CustomState extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.CustomState",version:"2.252.0"};endStates;stateJson;constructor(scope,id,props){super(scope,id,{});try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_CustomStateProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,CustomState),error}this.endStates=[this],this.stateJson=props.stateJson}addRetry(props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_RetryProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addRetry),error}return super._addRetry(props),this}addCatch(handler,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(handler),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_CatchProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addCatch),error}return super._addCatch(handler.startState,props),this}next(next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}return super.makeNext(next.startState),__1().Chain.sequence(this,next)}toStateJson(queryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(queryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}const state={...this.renderQueryLanguage(queryLanguage),...this.renderNextEnd(),...this.stateJson,...this.renderRetryCatch()};return this.hasMultipleRetrySources(state)&&this.addMultipleRetrySourcesWarning(),this.hasMultipleCatchSources(state)&&this.addMultipleCatchSourcesWarning(),Array.isArray(this.stateJson.Retry)&&(state.Retry=Array.isArray(state.Retry)?[...state.Retry,...this.stateJson.Retry]:[...this.stateJson.Retry]),Array.isArray(this.stateJson.Catch)&&(state.Catch=Array.isArray(state.Catch)?[...state.Catch,...this.stateJson.Catch]:[...this.stateJson.Catch]),state}hasMultipleRetrySources(state){return!Array.isArray(state.Retry)||!Array.isArray(this.stateJson.Retry)?!1:state.Retry.length>0&&this.stateJson.Retry.length>0}hasMultipleCatchSources(state){return!Array.isArray(state.Catch)||!Array.isArray(this.stateJson.Catch)?!1:state.Catch.length>0&&this.stateJson.Catch.length>0}addMultipleRetrySourcesWarning(){core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-stepfunctions:multipleRetrySources",["CustomState constructs can configure state retries using the stateJson property or by using the addRetry() function.","When retries are configured using both of these, the state definition's Retry field is generated ","by first rendering retries from addRetry(), then rendering retries from the stateJson."].join(`
`))}addMultipleCatchSourcesWarning(){core_1().Annotations.of(this).addWarningV2("@aws-cdk/aws-stepfunctions:multipleCatchSources",["CustomState constructs can configure state catchers using the stateJson property or by using the addCatch() function.","When catchers are configured using both of these, the state definition's Catch field is generated ","by first rendering catchers from addCatch(), then rendering catchers from the stateJson."].join(`
`))}}exports.CustomState=CustomState;

View File

@@ -0,0 +1,211 @@
import type { Construct } from 'constructs';
import type { ItemBatcher } from './distributed-map/item-batcher';
import type { IItemReader } from './distributed-map/item-reader';
import type { ResultWriter, ResultWriterV2 } from './distributed-map/result-writer';
import type { MapBaseJsonataOptions, MapBaseJsonPathOptions, MapBaseOptions, MapBaseProps } from './map-base';
import { MapBase } from './map-base';
import { StateGraph } from '../state-graph';
import { StateMachineType } from '../state-machine';
import type { CatchProps, IChainable, INextable, ProcessorConfig, RetryProps } from '../types';
import { QueryLanguage } from '../types';
import type { StateBaseProps } from './state';
interface DistributedMapBaseOptions extends MapBaseOptions {
/**
* MapExecutionType
*
* The execution type of the distributed map state
*
* This property overwrites ProcessorConfig.executionType
*
* @default StateMachineType.STANDARD
*/
readonly mapExecutionType?: StateMachineType;
/**
* ItemReader
*
* Configuration for where to read items dataset in S3 to iterate
*
* @default - No itemReader
*/
readonly itemReader?: IItemReader;
/**
* ToleratedFailurePercentage
*
* Percentage of failed items to tolerate in a Map Run, as static number
*
* @default - No toleratedFailurePercentage
*/
readonly toleratedFailurePercentage?: number;
/**
* ToleratedFailureCount
*
* Number of failed items to tolerate in a Map Run, as static number
*
* @default - No toleratedFailureCount
*/
readonly toleratedFailureCount?: number;
/**
* Label
*
* Unique name for the Distributed Map state added to each Map Run
*
* @default - No label
*/
readonly label?: string;
/**
* Configuration for S3 location in which to save Map Run results
*
* @deprecated Use {@link resultWriterV2}
* @default - No resultWriter
*/
readonly resultWriter?: ResultWriter;
/**
* Configuration for S3 location in which to save Map Run results
* Enable "@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2" feature in the context to use resultWriterV2
* Example: stack.node.setContext("@aws-cdk/aws-stepfunctions:useDistributedMapResultWriterV2", true);
*
* @default - No resultWriterV2
*/
readonly resultWriterV2?: ResultWriterV2;
/**
* Specifies to process a group of items in a single child workflow execution
*
* @default - No itemBatcher
*/
readonly itemBatcher?: ItemBatcher;
}
interface DistributedMapJsonPathOptions extends MapBaseJsonPathOptions {
/**
* ToleratedFailurePercentagePath
*
* Percentage of failed items to tolerate in a Map Run, as JsonPath
*
* @default - No toleratedFailurePercentagePath
*/
readonly toleratedFailurePercentagePath?: string;
/**
* ToleratedFailureCountPath
*
* Number of failed items to tolerate in a Map Run, as JsonPath
*
* @default - No toleratedFailureCountPath
*/
readonly toleratedFailureCountPath?: string;
}
/**
* Properties for configuring a Distribute Map state that using JSONPath
*/
export interface DistributedMapJsonPathProps extends StateBaseProps, DistributedMapBaseOptions, DistributedMapJsonPathOptions {
}
/**
* Properties for configuring a Distribute Map state that using JSONata
*/
export interface DistributedMapJsonataProps extends StateBaseProps, DistributedMapBaseOptions, MapBaseJsonataOptions {
}
/**
* Properties for configuring a Distribute Map state
*/
export interface DistributedMapProps extends MapBaseProps, DistributedMapBaseOptions, DistributedMapJsonPathOptions, MapBaseJsonataOptions {
}
/**
* Define a Distributed Mode Map state in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* A `Map` state in `Distributed` mode will execute a child workflow for each iteration of the Map state.
* This serves to increase concurrency and allows for larger workloads to be run in a single state machine.
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html
*/
export declare class DistributedMap extends MapBase implements INextable {
/**
* Define a Distributed Mode Map state using JSONPath in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* A `Map` state in `Distributed` mode will execute a child workflow for each iteration of the Map state.
* This serves to increase concurrency and allows for larger workloads to be run in a single state machine.
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html
*/
static jsonPath(scope: Construct, id: string, props?: DistributedMapJsonPathProps): DistributedMap;
/**
* Define a Distributed Mode Map state using JSONata in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* A `Map` state in `Distributed` mode will execute a child workflow for each iteration of the Map state.
* This serves to increase concurrency and allows for larger workloads to be run in a single state machine.
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-distributed.html
*/
static jsonata(scope: Construct, id: string, props?: DistributedMapJsonataProps): DistributedMap;
/**
* Return whether the given object is a DistributedMap.
*/
static isDistributedMap(x: any): x is DistributedMap;
private readonly mapExecutionType?;
private readonly itemReader?;
private readonly toleratedFailurePercentage?;
private readonly toleratedFailurePercentagePath?;
private readonly toleratedFailureCount?;
private readonly toleratedFailureCountPath?;
private readonly label?;
private readonly resultWriter?;
private readonly resultWriterV2?;
private readonly itemBatcher?;
constructor(scope: Construct, id: string, props?: DistributedMapProps);
private getResultWriter;
/**
* Validate this state
*/
protected validateState(): string[];
protected whenBoundToGraph(graph: StateGraph): void;
/**
* Add retry configuration for this state
*
* This controls if and how the execution will be retried if a particular
* error occurs.
*/
addRetry(props?: RetryProps): DistributedMap;
/**
* Add a recovery handler for this state
*
* When a particular error occurs, execution will continue at the error
* handler instead of failing the state machine execution.
*/
addCatch(handler: IChainable, props?: CatchProps): DistributedMap;
/**
* Define item processor in a Distributed Map.
*
* A Distributed Map must have a non-empty item processor
*/
itemProcessor(processor: IChainable, config?: ProcessorConfig): DistributedMap;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(stateMachineQueryLanguage?: QueryLanguage): object;
private addWarningIfResultWriterIsEmpty;
/**
* Render the ItemReader as JSON object
*/
private renderItemReader;
/**
* Render ResultWriter in ASL JSON format
*/
private renderResultWriter;
/**
* Render ItemBatcher in ASL JSON format
*/
private renderItemBatcher;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,64 @@
/**
* Interface for ItemBatcher configuration properties
*/
export interface ItemBatcherProps {
/**
* MaxItemsPerBatch
*
* Specifies the maximum number of items that each child workflow execution processes, as static number
*
* @default - uses value of `maxItemsPerBatchPath` as the max items per batch,
* no limits on the number of items in a batch under the 256KB limit if that property was also not provided
*/
readonly maxItemsPerBatch?: number;
/**
* MaxItemsPerBatchPath
*
* Specifies the maximum number of items that each child workflow execution processes, as JsonPath
*
* @default - uses value of `maxItemsPerBatch` as the max items per batch,
* no limits on the number of items in a batch under the 256KB limit if that property was also not provided
*/
readonly maxItemsPerBatchPath?: string;
/**
* MaxInputBytesPerBatch
*
* Specifies the maximum number of bytes that each child workflow execution processes, as static number
*
* @default - uses value of `maxInputBytesPerBatchPath` as the max size per batch,
* no limits on the batch size under the 256KB limit if that property was also not provided
*/
readonly maxInputBytesPerBatch?: number;
/**
* MaxInputBytesPerBatchPath
*
* Specifies the maximum number of bytes that each child workflow execution processes, as JsonPath
*
* @default - uses value of `maxInputBytesPerBatch` as the max size per batch,
* no limits on the batch size under the 256KB limit if that property was also not provided
*/
readonly maxInputBytesPerBatchPath?: string;
/**
* BatchInput
*
* Fixed JSON input to include in each batch passed to each child workflow execution
*
* @default - No batchInput
*/
readonly batchInput?: object;
}
/**
* Configuration for processing a group of items in a single child workflow execution
*/
export declare class ItemBatcher {
private props;
constructor(props: ItemBatcherProps);
/**
* Render ItemBatcher in ASL JSON format
*/
render(): any;
/**
* Validate this ItemBatcher
*/
validateItemBatcher(): string[];
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ItemBatcher=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");class ItemBatcher{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.ItemBatcher",version:"2.252.0"};props;constructor(props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ItemBatcherProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,ItemBatcher),error}this.props=props}render(){return{...this.props.maxItemsPerBatch&&{MaxItemsPerBatch:this.props.maxItemsPerBatch},...this.props.maxItemsPerBatchPath&&{MaxItemsPerBatchPath:this.props.maxItemsPerBatchPath},...this.props.maxInputBytesPerBatch&&{MaxInputBytesPerBatch:this.props.maxInputBytesPerBatch},...this.props.maxInputBytesPerBatchPath&&{MaxInputBytesPerBatchPath:this.props.maxInputBytesPerBatchPath},...this.props.batchInput&&{BatchInput:this.props.batchInput}}}validateItemBatcher(){const errors=[];return this.props.maxItemsPerBatch&&this.props.maxItemsPerBatchPath&&errors.push("Provide either `maxItemsPerBatch` or `maxItemsPerBatchPath`, but not both"),this.props.maxInputBytesPerBatch&&this.props.maxInputBytesPerBatchPath&&errors.push("Provide either `maxInputBytesPerBatch` or `maxInputBytesPerBatchPath`, but not both"),!this.props.maxItemsPerBatch&&!this.props.maxItemsPerBatchPath&&!this.props.maxInputBytesPerBatch&&!this.props.maxInputBytesPerBatchPath&&!this.props.batchInput&&errors.push("Provide at least one value to the ItemBatcher"),errors}}exports.ItemBatcher=ItemBatcher;

View File

@@ -0,0 +1,285 @@
import * as iam from '../../../../aws-iam';
import type { IBucket } from '../../../../aws-s3';
import { QueryLanguage } from '../../types';
/**
* Base interface for Item Reader configurations
*/
export interface IItemReader {
/**
* S3 Bucket containing objects to iterate over or a file with a list to iterate over
*/
readonly bucket: IBucket;
/**
* S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath
*/
readonly bucketNamePath?: string;
/**
* The Amazon S3 API action that Step Functions must invoke depending on the specified dataset.
*/
readonly resource: string;
/**
* Limits the number of items passed to the Distributed Map state
*
* @default - Distributed Map state will iterate over all items provided by the ItemReader
*/
readonly maxItems?: number;
/**
* Render the ItemReader as JSON object
*/
render(queryLanguage?: QueryLanguage): any;
/**
* Compile policy statements to provide relevent permissions to the state machine
*/
providePolicyStatements(): iam.PolicyStatement[];
/**
* Validate that ItemReader contains exactly either @see bucket or @see bucketNamePath
*/
validateItemReader(): string[];
}
/**
* Base interface for Item Reader configuration properties
*/
export interface ItemReaderProps {
/**
* S3 Bucket containing objects to iterate over or a file with a list to iterate over
*
* @default - S3 bucket will be determined from @see bucketNamePath
*/
readonly bucket?: IBucket;
/**
* S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath
*
* @default - S3 bucket will be determined from @see bucket
*/
readonly bucketNamePath?: string;
/**
* Limits the number of items passed to the Distributed Map state
*
* @default - Distributed Map state will iterate over all items provided by the ItemReader
*/
readonly maxItems?: number;
}
/**
* Properties for configuring an Item Reader that iterates over objects in an S3 bucket
*/
export interface S3ObjectsItemReaderProps extends ItemReaderProps {
/**
* S3 prefix used to limit objects to iterate over
*
* @default - No prefix
*/
readonly prefix?: string;
}
/**
* Item Reader configuration for iterating over objects in an S3 bucket
*/
export declare class S3ObjectsItemReader implements IItemReader {
private readonly _bucket?;
/**
* S3 Bucket containing objects to iterate over
*/
get bucket(): IBucket;
/**
* S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath
*/
readonly bucketNamePath?: string;
/**
* ARN for the `listObjectsV2` method of the S3 API
* This API method is used to iterate all objects in the S3 bucket/prefix
*/
readonly resource: string;
/**
* S3 prefix used to limit objects to iterate over
*
* @default - No prefix
*/
readonly prefix?: string;
/**
* Limits the number of items passed to the Distributed Map state
*
* @default - Distributed Map state will iterate over all items provided by the ItemReader
*/
readonly maxItems?: number;
constructor(props: S3ObjectsItemReaderProps);
/**
* Renders the ItemReader configuration as JSON object
* @returns - JSON object
*/
render(queryLanguage?: QueryLanguage): any;
/**
* Compile policy statements to provide relevent permissions to the state machine
*/
providePolicyStatements(): iam.PolicyStatement[];
/**
* Validate that ItemReader contains exactly either @see bucket or @see bucketNamePath
*/
validateItemReader(): string[];
}
/**
* Base interface for Item Reader configuration properties the iterate over entries in a S3 file
*/
export interface S3FileItemReaderProps extends ItemReaderProps {
/**
* Key of file stored in S3 bucket containing an array to iterate over
*/
readonly key: string;
}
/**
* Base Item Reader configuration for iterating over entries in a S3 file
*/
declare abstract class S3FileItemReader implements IItemReader {
private readonly _bucket?;
/**
* S3 Bucket containing a file with a list to iterate over
*/
get bucket(): IBucket;
/**
* S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath
*/
readonly bucketNamePath?: string;
/**
* S3 key of a file with a list to iterate over
*/
readonly key: string;
/**
* ARN for the `getObject` method of the S3 API
* This API method is used to iterate all objects in the S3 bucket/prefix
*/
readonly resource: string;
/**
* Limits the number of items passed to the Distributed Map state
*
* @default - No maxItems
*/
readonly maxItems?: number;
protected abstract readonly inputType: string;
constructor(props: S3FileItemReaderProps);
/**
* Renders the ItemReader configuration as JSON object
* @returns - JSON object
*/
render(queryLanguage?: QueryLanguage): any;
/**
* Compile policy statements to provide relevent permissions to the state machine
*/
providePolicyStatements(): iam.PolicyStatement[];
/**
* Validate that ItemReader contains exactly either @see bucket or @see bucketNamePath
*/
validateItemReader(): string[];
}
/**
* Item Reader configuration for iterating over items in a JSON array stored in a S3 file
*/
export declare class S3JsonItemReader extends S3FileItemReader {
protected readonly inputType: string;
}
/**
* Item Reader configuration for iterating over the rows of the JSONL file stored in S3
*/
export declare class S3JsonLItemReader extends S3FileItemReader {
protected readonly inputType: string;
}
/**
* CSV header location options
*/
export declare enum CsvHeaderLocation {
/**
* Headers will be read from first row of CSV file
*/
FIRST_ROW = "FIRST_ROW",
/**
* Headers are provided in CSVHeaders property
*/
GIVEN = "GIVEN"
}
/**
* Configuration for CSV header options for a CSV Item Reader
*/
export declare class CsvHeaders {
/**
* Configures S3CsvItemReader to read headers from the first row of the CSV file
* @returns - CsvHeaders
*/
static useFirstRow(): CsvHeaders;
/**
* Configures S3CsvItemReader to use the headers provided in the `headers` parameter
* @param headers - List of headers
* @returns - CsvHeaders
*/
static use(headers: string[]): CsvHeaders;
/**
* Location of headers in CSV file
*/
readonly headerLocation: CsvHeaderLocation;
/**
* List of headers if `headerLocation` is `GIVEN`
*/
readonly headers?: string[];
private constructor();
}
/**
* Properties for configuring an Item Reader that iterates over items in a CSV file in S3
*/
export interface S3CsvItemReaderProps extends S3FileItemReaderProps {
/**
* CSV file header configuration
*
* @default - CsvHeaders with CsvHeadersLocation.FIRST_ROW
*/
readonly csvHeaders?: CsvHeaders;
/**
* Delimiter used in a CSV file
*
* @default undefined - Default setting is COMMA.
*/
readonly csvDelimiter?: CsvDelimiter;
}
/**
* Delimiter used in CSV file
*/
export declare enum CsvDelimiter {
/**
* Comma delimiter
*/
COMMA = "COMMA",
/**
* Pipe delimiter
*/
PIPE = "PIPE",
/**
* Semicolon delimiter
*/
SEMICOLON = "SEMICOLON",
/**
* Space delimiter
*/
SPACE = "SPACE",
/**
* Tab delimiter
*/
TAB = "TAB"
}
/**
* Item Reader configuration for iterating over items in a CSV file stored in S3
*/
export declare class S3CsvItemReader extends S3FileItemReader {
/**
* CSV headers configuration
*/
readonly csvHeaders: CsvHeaders;
/**
* Delimiter used in CSV file
*/
readonly csvDelimiter?: CsvDelimiter;
protected readonly inputType: string;
constructor(props: S3CsvItemReaderProps);
render(queryLanguage?: QueryLanguage): any;
}
/**
* Item Reader configuration for iterating over items in a S3 inventory manifest file stored in S3
*/
export declare class S3ManifestItemReader extends S3FileItemReader {
protected readonly inputType: string;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,172 @@
import * as iam from '../../../../aws-iam';
import type { IBucket } from '../../../../aws-s3';
import { QueryLanguage } from '../../types';
/**
* Interface for Result Writer configuration props
* @deprecated use {@link ResultWriterV2Props} instead
*/
export interface ResultWriterProps {
/**
* S3 Bucket in which to save Map Run results
*/
readonly bucket: IBucket;
/**
* S3 prefix in which to save Map Run results
*
* @default - No prefix
*/
readonly prefix?: string;
}
/**
* Interface for Result Writer configuration props
*/
export interface ResultWriterV2Props {
/**
* S3 Bucket in which to save Map Run results
* @default - specify a bucket
*/
readonly bucket?: IBucket;
/**
* S3 bucket name in which to save Map Run results, as JsonPath
*
* @default - no bucket path
*/
readonly bucketNamePath?: string;
/**
* S3 prefix in which to save Map Run results
*
* @default - No prefix
*/
readonly prefix?: string;
/**
* Configuration to format the output of the Child Workflow executions
*
* @default - Specify both Transformation and OutputType
*/
readonly writerConfig?: WriterConfig;
}
/**
* The transformation to be applied to the Output of the Child Workflow executions
*/
export declare enum Transformation {
/**
* Returns the output of the child workflow executions unchanged, in addition to the workflow metadata.
* Default when exporting the child workflow execution results to Amazon S3 and WriterConfig is not specified.
*/
NONE = "NONE",
/**
* Returns the output of the child workflow executions. Default when ResultWriter is not specified.
*/
COMPACT = "COMPACT",
/**
* Returns the output of the child workflow executions.
* If a child workflow execution returns an array,this option flattens the array,
* prior to returning the result to a state output or writing the result to an Amazon S3 object.
*/
FLATTEN = "FLATTEN"
}
/**
* The format of the Output of the child workflow executions
*/
export declare enum OutputType {
/**
* Formats the results as a JSON array
*/
JSON = "JSON",
/**
* Formats the results as JSON Lines
*/
JSONL = "JSONL"
}
/**
* Interface for Writer Config props
*/
export interface WriterConfigProps {
/**
* The transformation to be applied to the Output of the Child Workflow executions
*/
readonly transformation: Transformation;
/**
* The format of the Output of the child workflow executions
*/
readonly outputType: OutputType;
}
/**
* Configuration to format the output
*/
export declare class WriterConfig {
/**
* The transformation to be applied to the Output of the Child Workflow executions
*/
readonly transformation: Transformation;
/**
* The format of the Output of the child workflow executions
*/
readonly outputType: OutputType;
constructor(props: WriterConfigProps);
}
/**
* Configuration for writing Distributed Map state results to S3
* @deprecated use {@link ResultWriterV2} instead
*/
export declare class ResultWriter {
/**
* S3 Bucket in which to save Map Run results
*/
readonly bucket: IBucket;
/**
* S3 prefix in which to save Map Run results
*
* @default - No prefix
*/
readonly prefix?: string;
constructor(props: ResultWriterProps);
/**
* Render ResultWriter in ASL JSON format
*/
render(queryLanguage?: QueryLanguage): any;
/**
* Compile policy statements to provide relevent permissions to the state machine
*/
providePolicyStatements(): iam.PolicyStatement[];
}
/**
* Configuration for writing Distributed Map state results to S3
* The ResultWriter field cannot be empty. You must specify one of these sets of sub-fields.
* writerConfig - to preview the formatted output, without saving the results to Amazon S3.
* bucket and prefix - to save the results to Amazon S3 without additional formatting.
* All three fields: writerConfig, bucket and prefix - to format the output and save it to Amazon S3.
*/
export declare class ResultWriterV2 {
/**
* S3 Bucket in which to save Map Run results
*/
readonly bucket?: IBucket;
/**
* S3 bucket name in which to save Map Run results, as JsonPath
*/
readonly bucketNamePath?: string;
/**
* S3 prefix in which to save Map Run results
*
* @default - No prefix
*/
readonly prefix?: string;
/**
* Configuration to format the output of the Child Workflow executions
*/
readonly writerConfig?: WriterConfig;
constructor(props: ResultWriterV2Props);
/**
* Render ResultWriter in ASL JSON format
*/
render(queryLanguage?: QueryLanguage): any;
/**
* Compile policy statements to provide relevent permissions to the state machine
*/
providePolicyStatements(): iam.PolicyStatement[];
/**
* Validate that ResultWriter contains exactly either @see bucket or @see bucketNamePath
*/
validateResultWriter(): string[];
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,91 @@
import type { Construct } from 'constructs';
import type { StateBaseProps } from './state';
import { State } from './state';
import type { INextable } from '../types';
import { QueryLanguage } from '../types';
interface FailBaseOptions {
/**
* Error code used to represent this failure
*
* @default - No error code
*/
readonly error?: string;
/**
* A description for the cause of the failure
*
* @default - No description
*/
readonly cause?: string;
}
interface FailJsonPathOptions {
/**
* JsonPath expression to select part of the state to be the error to this state.
*
* You can also use an intrinsic function that returns a string to specify this property.
* The allowed functions include States.Format, States.JsonToString, States.ArrayGetItem, States.Base64Encode, States.Base64Decode, States.Hash, and States.UUID.
*
* @default - No error path
*/
readonly errorPath?: string;
/**
* JsonPath expression to select part of the state to be the cause to this state.
*
* You can also use an intrinsic function that returns a string to specify this property.
* The allowed functions include States.Format, States.JsonToString, States.ArrayGetItem, States.Base64Encode, States.Base64Decode, States.Hash, and States.UUID.
*
* @default - No cause path
*/
readonly causePath?: string;
}
/**
* Properties for defining a Fail state that using JSONPath
*/
export interface FailJsonPathProps extends StateBaseProps, FailBaseOptions, FailJsonPathOptions {
}
/**
* Properties for defining a Fail state that using JSONata
*/
export interface FailJsonataProps extends StateBaseProps, FailBaseOptions {
}
/**
* Properties for defining a Fail state
*/
export interface FailProps extends StateBaseProps, FailBaseOptions, FailJsonPathOptions {
}
/**
* Define a Fail state in the state machine
*
* Reaching a Fail state terminates the state execution in failure.
*/
export declare class Fail extends State {
/**
* Define a Fail state using JSONPath in the state machine
*
* Reaching a Fail state terminates the state execution in failure.
*/
static jsonPath(scope: Construct, id: string, props?: FailJsonPathProps): Fail;
/**
* Define a Fail state using JSONata in the state machine
*
* Reaching a Fail state terminates the state execution in failure.
*/
static jsonata(scope: Construct, id: string, props?: FailJsonataProps): Fail;
private static allowedIntrinsics;
readonly endStates: INextable[];
private readonly error?;
private readonly errorPath?;
private readonly cause?;
private readonly causePath?;
constructor(scope: Construct, id: string, props?: FailProps);
/**
* Return the Amazon States Language object for this state
*/
toStateJson(queryLanguage?: QueryLanguage): object;
/**
* Validate this state
*/
protected validateState(): string[];
private isIntrinsicString;
private isAllowedIntrinsic;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Fail=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class Fail extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Fail",version:"2.252.0"};static jsonPath(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_FailJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Fail(scope,id,props)}static jsonata(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_FailJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Fail(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}static allowedIntrinsics=["States.Format","States.JsonToString","States.ArrayGetItem","States.Base64Encode","States.Base64Decode","States.Hash","States.UUID"];endStates=[];error;errorPath;cause;causePath;constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_FailProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Fail),error}this.error=props.error,this.errorPath=props.errorPath,this.cause=props.cause,this.causePath=props.causePath}toStateJson(queryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(queryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{Type:state_type_1().StateType.FAIL,...this.renderQueryLanguage(queryLanguage),Comment:this.comment,Error:this.error,ErrorPath:this.isIntrinsicString(this.errorPath)?this.errorPath:(0,state_1().renderJsonPath)(this.errorPath),Cause:this.cause,CausePath:this.isIntrinsicString(this.causePath)?this.causePath:(0,state_1().renderJsonPath)(this.causePath)}}validateState(){const errors=super.validateState();return this.errorPath&&this.isIntrinsicString(this.errorPath)&&!this.isAllowedIntrinsic(this.errorPath)&&errors.push(`You must specify a valid intrinsic function in errorPath. Must be one of ${Fail.allowedIntrinsics.join(", ")}`),this.causePath&&this.isIntrinsicString(this.causePath)&&!this.isAllowedIntrinsic(this.causePath)&&errors.push(`You must specify a valid intrinsic function in causePath. Must be one of ${Fail.allowedIntrinsics.join(", ")}`),this.error&&this.errorPath&&errors.push("Fail state cannot have both error and errorPath"),this.cause&&this.causePath&&errors.push("Fail state cannot have both cause and causePath"),errors}isIntrinsicString(jsonPath){return!core_1().Token.isUnresolved(jsonPath)&&!jsonPath?.startsWith("$")}isAllowedIntrinsic(intrinsic){return Fail.allowedIntrinsics.some(allowed=>intrinsic.startsWith(allowed))}}exports.Fail=Fail;

View File

@@ -0,0 +1,186 @@
import type { Construct } from 'constructs';
import type { AssignableStateOptions, JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import { Chain } from '../chain';
import type { IChainable, INextable, QueryLanguage } from '../types';
/**
* Base properties for defining a Map state that using JSONPath
*/
export interface MapBaseJsonPathOptions extends JsonPathCommonOptions {
/**
* JSONPath expression to select the array to iterate over
*
* @default $
*/
readonly itemsPath?: string;
/**
* MaxConcurrencyPath
*
* A JsonPath that specifies the maximum concurrency dynamically from the state input.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-additional-fields
*
* @default - full concurrency
*/
readonly maxConcurrencyPath?: string;
/**
* JSONPath expression to indicate where to inject the state's output
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* @default $
*/
readonly resultPath?: string;
/**
* The JSON that will replace the state's raw result and become the effective
* result before ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector
*
* @default - None
*/
readonly resultSelector?: {
[key: string]: any;
};
}
/**
* The array that the Map state will iterate over.
*/
export declare abstract class ProvideItems {
/**
* Use a JSON array as Map state items.
*
* Example value: `[1, "{% $two %}", 3]`
*/
static jsonArray(array: any[]): ProvideItems;
/**
* Use a JSONata expression as Map state items.
*
* Example value: `{% $states.input.items %}`
*/
static jsonata(jsonataExpression: string): ProvideItems;
/**
* The array that the Map state will iterate over.
*/
abstract readonly items: any;
}
/**
* Base properties for defining a Map state that using JSONata
*/
export interface MapBaseJsonataOptions extends JsonataCommonOptions {
/**
* The array that the Map state will iterate over.
* @default - The state input as is.
*/
readonly items?: ProvideItems;
}
/**
* Base properties for defining a Map state
*/
export interface MapBaseOptions extends AssignableStateOptions {
/**
* MaxConcurrency
*
* An upper bound on the number of iterations you want running at once.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-additional-fields
*
* @default - full concurrency
*/
readonly maxConcurrency?: number;
/**
* JSONata expression for MaxConcurrency
*
* A JSONata expression that evaluates to an integer, specifying the maximum
* concurrency dynamically. Mutually exclusive with `maxConcurrency` and
* `maxConcurrencyPath`.
*
* Example value: `{% $states.input.maxConcurrency %}`
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-asl-use-map-state-inline.html#map-state-inline-additional-fields
*
* @default - full concurrency
*/
readonly jsonataMaxConcurrency?: string;
/**
* The JSON that you want to override your default iteration input (mutually exclusive with `parameters` and `jsonataItemSelector`).
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-itemselector.html
*
* @default $
*/
readonly itemSelector?: {
[key: string]: any;
};
/**
* Jsonata expression that evaluates to a JSON array to override your default iteration input (mutually exclusive with `parameters` and `itemSelector`).
*
* Example value: `{% {\"foo\": \"foo\", \"input\": $states.input} %}`
*
* @default $
*/
readonly jsonataItemSelector?: string;
}
/**
* Properties for defining a Map state
*/
export interface MapBaseProps extends StateBaseProps, MapBaseOptions, MapBaseJsonPathOptions, MapBaseJsonataOptions {
}
/**
* Returns true if the value passed is a positive integer
* @param value the value to validate
*/
export declare const isPositiveInteger: (value: number) => boolean;
/**
* Define a Map state in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html
*/
export declare abstract class MapBase extends State implements INextable {
readonly endStates: INextable[];
private readonly maxConcurrency?;
private readonly maxConcurrencyPath?;
private readonly jsonataMaxConcurrency?;
protected readonly items?: ProvideItems;
protected readonly itemsPath?: string;
protected readonly itemSelector?: {
[key: string]: any;
};
protected readonly jsonataItemSelector?: string;
constructor(scope: Construct, id: string, props?: MapBaseProps);
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(topLevelQueryLanguage?: QueryLanguage): object;
/**
* Validate this state
*/
protected validateState(): string[];
private renderItemsPath;
/**
* Render ItemSelector in ASL JSON format
*/
private renderItemSelector;
/**
* Render MaxConcurrency in ASL JSON format
*/
private renderMaxConcurrency;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,116 @@
import type { Construct } from 'constructs';
import type { MapBaseJsonataOptions, MapBaseJsonPathOptions, MapBaseOptions, MapBaseProps } from './map-base';
import { MapBase } from './map-base';
import type { CatchProps, IChainable, INextable, ProcessorConfig, RetryProps } from '../types';
import { QueryLanguage } from '../types';
import type { StateBaseProps } from './state';
interface MapOptions extends MapBaseOptions {
/**
* The JSON that you want to override your default iteration input (mutually exclusive with `itemSelector`).
*
* @deprecated Step Functions has deprecated the `parameters` field in favor of
* the new `itemSelector` field
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-itemselector.html
*
* @default $
*/
readonly parameters?: {
[key: string]: any;
};
}
/**
* Properties for defining a Map state that using JSONPath
*/
export interface MapJsonPathProps extends StateBaseProps, MapOptions, MapBaseJsonPathOptions {
}
/**
* Properties for defining a Map state that using JSONata
*/
export interface MapJsonataProps extends StateBaseProps, MapOptions, MapBaseJsonataOptions {
}
/**
* Properties for defining a Map state
*/
export interface MapProps extends MapBaseProps, MapOptions {
}
/**
* Define a Map state in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html
*/
export declare class Map extends MapBase implements INextable {
/**
* Define a Map state using JSONPath in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html
*/
static jsonPath(scope: Construct, id: string, props?: MapJsonPathProps): Map;
/**
* Define a Map state using JSONata in the state machine
*
* A `Map` state can be used to run a set of steps for each element of an input array.
* A Map state will execute the same steps for multiple entries of an array in the state input.
*
* While the Parallel state executes multiple branches of steps using the same input, a Map state
* will execute the same steps for multiple entries of an array in the state input.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-map-state.html
*/
static jsonata(scope: Construct, id: string, props?: MapJsonataProps): Map;
constructor(scope: Construct, id: string, props?: MapProps);
/**
* Define iterator state machine in Map.
*
* A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with `itemProcessor`).
*
* @deprecated - use `itemProcessor` instead.
*/
iterator(iterator: IChainable): Map;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(queryLanguage?: QueryLanguage): object;
/**
* Validate this state
*/
protected validateState(): string[];
/**
* Render Parameters in ASL JSON format
*/
private renderParameters;
/**
* Add retry configuration for this state
*
* This controls if and how the execution will be retried if a particular
* error occurs.
*/
addRetry(props?: RetryProps): Map;
/**
* Add a recovery handler for this state
*
* When a particular error occurs, execution will continue at the error
* handler instead of failing the state machine execution.
*/
addCatch(handler: IChainable, props?: CatchProps): Map;
/**
* Define item processor in Map.
*
* A Map must either have a non-empty iterator or a non-empty item processor (mutually exclusive with `iterator`).
*/
itemProcessor(processor: IChainable, config?: ProcessorConfig): Map;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Map=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var map_base_1=()=>{var tmp=require("./map-base");return map_base_1=()=>tmp,tmp},fields_1=()=>{var tmp=require("../fields");return fields_1=()=>tmp,tmp},state_graph_1=()=>{var tmp=require("../state-graph");return state_graph_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class Map extends map_base_1().MapBase{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Map",version:"2.252.0"};static jsonPath(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_MapJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Map(scope,id,props)}static jsonata(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_MapJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Map(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_MapProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Map),error}this.processorMode=types_1().ProcessorMode.INLINE}iterator(iterator){try{jsiiDeprecationWarnings().print("aws-cdk-lib.aws_stepfunctions.Map#iterator","- use `itemProcessor`\xA0instead."),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(iterator)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.iterator),error}const name=`Map ${this.stateId} Iterator`;return super.addIterator(new(state_graph_1()).StateGraph(iterator.startState,name)),this}toStateJson(queryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(queryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{...super.toStateJson(queryLanguage),...this.renderParameters(),...this.renderIterator()}}validateState(){const errors=super.validateState();return!this.iteration&&!this.processor&&errors.push("Map state must either have a non-empty iterator or a non-empty item processor"),this.iteration&&this.processor&&errors.push("Map state cannot have both an iterator and an item processor"),this.parameters&&(this.itemSelector||this.jsonataItemSelector)&&errors.push("Map state cannot have both parameters and an item selector"),errors}renderParameters(){if(this.parameters)return fields_1().FieldUtils.renderObject({Parameters:this.parameters})}addRetry(props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_RetryProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addRetry),error}return super._addRetry(props),this}addCatch(handler,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(handler),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_CatchProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addCatch),error}return super._addCatch(handler.startState,props),this}itemProcessor(processor,config={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(processor),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ProcessorConfig(config)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.itemProcessor),error}const name=`Map ${this.stateId} Item Processor`,stateGraph=new(state_graph_1()).StateGraph(processor.startState,name);return super.addItemProcessor(stateGraph,config),this}}exports.Map=Map;

View File

@@ -0,0 +1,144 @@
import type { Construct } from 'constructs';
import type { AssignableStateOptions, JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import { Chain } from '../chain';
import { StateGraph } from '../state-graph';
import type { CatchProps, IChainable, INextable, RetryProps } from '../types';
import { QueryLanguage } from '../types';
interface ParallelJsonPathOptions extends JsonPathCommonOptions {
/**
* JSONPath expression to indicate where to inject the state's output
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* @default $
*/
readonly resultPath?: string;
/**
* The JSON that will replace the state's raw result and become the effective
* result before ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector
*
* @default - None
*/
readonly resultSelector?: {
[key: string]: any;
};
/**
* Parameters pass a collection of key-value pairs, either static values or JSONPath expressions that select from the input.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-parameters
*
* @default No parameters
*/
readonly parameters?: {
[name: string]: any;
};
}
interface ParallelJsonataOptions extends JsonataCommonOptions {
/**
* Parameters pass a collection of key-value pairs, either static values or JSONata expressions that select from the input.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/transforming-data.html
*
* @default No arguments
*/
readonly arguments?: {
[name: string]: any;
};
}
/**
* Properties for defining a Parallel state that using JSONPath
*/
export interface ParallelJsonPathProps extends StateBaseProps, AssignableStateOptions, ParallelJsonPathOptions {
}
/**
* Properties for defining a Parallel state that using JSONata
*/
export interface ParallelJsonataProps extends StateBaseProps, AssignableStateOptions, ParallelJsonataOptions {
}
/**
* Properties for defining a Parallel state
*/
export interface ParallelProps extends StateBaseProps, AssignableStateOptions, ParallelJsonPathOptions, ParallelJsonataOptions {
}
/**
* Define a Parallel state in the state machine
*
* A Parallel state can be used to run one or more state machines at the same
* time.
*
* The Result of a Parallel state is an array of the results of its substatemachines.
*/
export declare class Parallel extends State implements INextable {
/**
* Define a Parallel state using JSONPath in the state machine
*
* A Parallel state can be used to run one or more state machines at the same
* time.
*
* The Result of a Parallel state is an array of the results of its substatemachines.
*/
static jsonPath(scope: Construct, id: string, props?: ParallelJsonPathProps): Parallel;
/**
* Define a Parallel state using JSONata in the state machine
*
* A Parallel state can be used to run one or more state machines at the same
* time.
*
* The Result of a Parallel state is an array of the results of its substatemachines.
*/
static jsonata(scope: Construct, id: string, props?: ParallelJsonataProps): Parallel;
readonly endStates: INextable[];
private readonly _branches;
constructor(scope: Construct, id: string, props?: ParallelProps);
/**
* Add retry configuration for this state
*
* This controls if and how the execution will be retried if a particular
* error occurs.
*/
addRetry(props?: RetryProps): Parallel;
/**
* Add a recovery handler for this state
*
* When a particular error occurs, execution will continue at the error
* handler instead of failing the state machine execution.
*/
addCatch(handler: IChainable, props?: CatchProps): Parallel;
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Define one or more branches to run in parallel
*/
branch(...branches: IChainable[]): Parallel;
/**
* Overwrites State.bindToGraph. Adds branches to
* the Parallel state here so that any necessary
* prefixes are appended first.
*/
bindToGraph(graph: StateGraph): void;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(topLevelQueryLanguage?: QueryLanguage): object;
/**
* Render Parameters in ASL JSON format
*/
private renderParameters;
/**
* Validate this state
*/
protected validateState(): string[];
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Parallel=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},chain_1=()=>{var tmp=require("../chain");return chain_1=()=>tmp,tmp},fields_1=()=>{var tmp=require("../fields");return fields_1=()=>tmp,tmp},state_graph_1=()=>{var tmp=require("../state-graph");return state_graph_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class Parallel extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Parallel",version:"2.252.0"};static jsonPath(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ParallelJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Parallel(scope,id,props)}static jsonata(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ParallelJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Parallel(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}endStates;_branches=[];constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_ParallelProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Parallel),error}this.endStates=[this]}addRetry(props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_RetryProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addRetry),error}return super._addRetry(props),this}addCatch(handler,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(handler),jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_CatchProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.addCatch),error}return super._addCatch(handler.startState,props),this}next(next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}return super.makeNext(next.startState),chain_1().Chain.sequence(this,next)}branch(...branches){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(branches)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.branch),error}return this._branches.push(...branches),this}bindToGraph(graph){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_StateGraph(graph)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.bindToGraph),error}for(const branch of this._branches){const name=`Parallel '${this.stateId}' branch ${this.branches.length+1}`;super.addBranch(new(state_graph_1()).StateGraph(branch.startState,name))}return this._branches.splice(0,this._branches.length),super.bindToGraph(graph)}toStateJson(topLevelQueryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(topLevelQueryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{Type:state_type_1().StateType.PARALLEL,...this.renderQueryLanguage(topLevelQueryLanguage),Comment:this.comment,ResultPath:(0,state_1().renderJsonPath)(this.resultPath),...this.renderNextEnd(),...this.renderInputOutput(),...this.renderRetryCatch(),...this.renderBranches(),...this.renderResultSelector(),...this.renderParameters(),...this.renderAssign(topLevelQueryLanguage)}}renderParameters(){if(this.parameters)return fields_1().FieldUtils.renderObject({Parameters:this.parameters})}validateState(){return this.branches.length===0?["Parallel must have at least one branch"]:[]}}exports.Parallel=Parallel;

View File

@@ -0,0 +1,119 @@
import type { Construct } from 'constructs';
import type { AssignableStateOptions, JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import { Chain } from '../chain';
import type { IChainable, INextable } from '../types';
import { QueryLanguage } from '../types';
/**
* The result of a Pass operation
*/
export declare class Result {
readonly value: any;
/**
* The result of the operation is a string
*/
static fromString(value: string): Result;
/**
* The result of the operation is a number
*/
static fromNumber(value: number): Result;
/**
* The result of the operation is a boolean
*/
static fromBoolean(value: boolean): Result;
/**
* The result of the operation is an object
*/
static fromObject(value: {
[key: string]: any;
}): Result;
/**
* The result of the operation is an array
*/
static fromArray(value: any[]): Result;
/**
*
* @param value result of the Pass operation
*/
protected constructor(value: any);
}
interface PassJsonPathOptions extends JsonPathCommonOptions {
/**
* If given, treat as the result of this operation
*
* Can be used to inject or replace the current execution state.
*
* @default No injected result
*/
readonly result?: Result;
/**
* JSONPath expression to indicate where to inject the state's output
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* @default $
*/
readonly resultPath?: string;
/**
* Parameters pass a collection of key-value pairs, either static values or JSONPath expressions that select from the input.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-parameters
*
* @default No parameters
*/
readonly parameters?: {
[name: string]: any;
};
}
/**
* Properties for defining a Pass state that using JSONPath
*/
export interface PassJsonPathProps extends StateBaseProps, AssignableStateOptions, PassJsonPathOptions {
}
/**
* Properties for defining a Pass state that using JSONata
*/
export interface PassJsonataProps extends StateBaseProps, AssignableStateOptions, JsonataCommonOptions {
}
/**
* Properties for defining a Pass state
*/
export interface PassProps extends StateBaseProps, AssignableStateOptions, PassJsonPathOptions, JsonataCommonOptions {
}
/**
* Define a Pass in the state machine
*
* A Pass state can be used to transform the current execution's state.
*/
export declare class Pass extends State implements INextable {
/**
* Define a Pass using JSONPath in the state machine
*
* A Pass state can be used to transform the current execution's state.
*/
static jsonPath(scope: Construct, id: string, props?: PassJsonPathProps): Pass;
/**
* Define a Pass using JSONata in the state machine
*
* A Pass state can be used to transform the current execution's state.
*/
static jsonata(scope: Construct, id: string, props?: PassJsonataProps): Pass;
readonly endStates: INextable[];
private readonly result?;
constructor(scope: Construct, id: string, props?: PassProps);
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(topLevelQueryLanguage?: QueryLanguage): object;
/**
* Render Parameters in ASL JSON format
*/
private renderParameters;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Pass=exports.Result=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},chain_1=()=>{var tmp=require("../chain");return chain_1=()=>tmp,tmp},fields_1=()=>{var tmp=require("../fields");return fields_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class Result{value;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Result",version:"2.252.0"};static fromString(value){return new Result(value)}static fromNumber(value){return new Result(value)}static fromBoolean(value){return new Result(value)}static fromObject(value){return new Result(value)}static fromArray(value){return new Result(value)}constructor(value){this.value=value}}exports.Result=Result;class Pass extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Pass",version:"2.252.0"};static jsonPath(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_PassJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Pass(scope,id,props)}static jsonata(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_PassJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Pass(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}endStates;result;constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_PassProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Pass),error}this.result=props.result,this.endStates=[this]}next(next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}return super.makeNext(next.startState),chain_1().Chain.sequence(this,next)}toStateJson(topLevelQueryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(topLevelQueryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{Type:state_type_1().StateType.PASS,...this.renderQueryLanguage(topLevelQueryLanguage),Comment:this.comment,Result:this.result?.value,ResultPath:(0,state_1().renderJsonPath)(this.resultPath),...this.renderInputOutput(),...this.renderParameters(),...this.renderNextEnd(),...this.renderAssign(topLevelQueryLanguage)}}renderParameters(){return fields_1().FieldUtils.renderObject({Parameters:this.parameters})}}exports.Pass=Pass;

View File

@@ -0,0 +1,13 @@
/**
* State types
*/
export declare enum StateType {
PASS = "Pass",
TASK = "Task",
CHOICE = "Choice",
WAIT = "Wait",
SUCCEED = "Succeed",
FAIL = "Fail",
PARALLEL = "Parallel",
MAP = "Map"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StateType=void 0;var StateType;(function(StateType2){StateType2.PASS="Pass",StateType2.TASK="Task",StateType2.CHOICE="Choice",StateType2.WAIT="Wait",StateType2.SUCCEED="Succeed",StateType2.FAIL="Fail",StateType2.PARALLEL="Parallel",StateType2.MAP="Map"})(StateType||(exports.StateType=StateType={}));

View File

@@ -0,0 +1,388 @@
import type { IConstruct } from 'constructs';
import { Construct } from 'constructs';
import type { Condition } from '../condition';
import type { StateGraph } from '../state-graph';
import type { CatchProps, IChainable, INextable, ProcessorConfig, RetryProps } from '../types';
import { ProcessorMode, QueryLanguage } from '../types';
/**
* Properties shared by all states
*/
export interface StateBaseProps {
/**
* The name of the query language used by the state.
* If the state does not contain a `queryLanguage` field,
* then it will use the query language specified in the top-level `queryLanguage` field.
*
* @default - JSONPath
*/
readonly queryLanguage?: QueryLanguage;
/**
* Optional name for this state
*
* @default - The construct ID will be used as state name
*/
readonly stateName?: string;
/**
* A comment describing this state
*
* @default No comment
*/
readonly comment?: string;
}
/**
* Option properties for JSONPath state.
*/
export interface JsonPathCommonOptions {
/**
* JSONPath expression to select part of the state to be the input to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* input to be the empty object {}.
*
* @default $
*/
readonly inputPath?: string;
/**
* JSONPath expression to select part of the state to be the output to this state.
*
* May also be the special value JsonPath.DISCARD, which will cause the effective
* output to be the empty object {}.
*
* @default $
*/
readonly outputPath?: string;
}
interface JsonPathStateOptions extends JsonPathCommonOptions {
/**
* JSONPath expression to indicate where to inject the state's output
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* @default $
*/
readonly resultPath?: string;
/**
* The JSON that will replace the state's raw result and become the effective
* result before ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector
*
* @default - None
*/
readonly resultSelector?: {
[key: string]: any;
};
/**
* Parameters pass a collection of key-value pairs, either static values or JSONPath expressions that select from the input.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-parameters
*
* @default No parameters
*/
readonly parameters?: {
[name: string]: any;
};
}
/**
* Option properties for JSONata state.
*/
export interface JsonataCommonOptions {
/**
* Used to specify and transform output from the state.
* When specified, the value overrides the state output default.
* The output field accepts any JSON value (object, array, string, number, boolean, null).
* Any string value, including those inside objects or arrays,
* will be evaluated as JSONata if surrounded by {% %} characters.
* Output also accepts a JSONata expression directly.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-input-output-filtering.html
*
* @default - $states.result or $states.errorOutput
*/
readonly outputs?: any;
}
/**
* Option properties for JSONata task state.
*/
export interface JsonataStateOptions extends JsonataCommonOptions {
/**
* Parameters pass a collection of key-value pairs, either static values or JSONata expressions that select from the input.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/transforming-data.html
*
* @default - No arguments
*/
readonly arguments?: any;
}
/**
* Option properties for state that can assign variables.
*/
export interface AssignableStateOptions {
/**
* Workflow variables to store in this step.
* Using workflow variables, you can store data in a step and retrieve that data in future steps.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/workflow-variables.html
*
* @default - Not assign variables
*/
readonly assign?: {
[name: string]: any;
};
}
/**
* Properties shared by all states that use JSONPath
*/
export interface JsonPathStateProps extends StateBaseProps, JsonPathStateOptions, AssignableStateOptions {
}
/**
* Properties shared by all states that use JSONata
*/
export interface JsonataStateProps extends StateBaseProps, JsonataStateOptions, AssignableStateOptions {
}
/**
* Properties shared by all states
*/
export interface StateProps extends StateBaseProps, JsonPathStateOptions, JsonataStateOptions, AssignableStateOptions {
}
/**
* Base class for all other state classes
*/
export declare abstract class State extends Construct implements IChainable {
/**
* Add a prefix to the stateId of all States found in a construct tree
*/
static prefixStates(root: IConstruct, prefix: string): void;
/**
* Find the set of states reachable through transitions from the given start state.
* This does not retrieve states from within sub-graphs, such as states within a Parallel state's branch.
*/
static findReachableStates(start: State, options?: FindStateOptions): State[];
/**
* Find the set of end states states reachable through transitions from the given start state
*/
static findReachableEndStates(start: State, options?: FindStateOptions): State[];
/**
* Return only the states that allow chaining from an array of states
*/
static filterNextables(states: State[]): INextable[];
/**
* First state of this Chainable
*/
readonly startState: State;
/**
* Continuable states of this Chainable
*/
abstract readonly endStates: INextable[];
protected readonly stateName?: string;
protected readonly comment?: string;
protected readonly inputPath?: string;
protected readonly parameters?: object;
protected readonly outputPath?: string;
protected readonly resultPath?: string;
protected readonly resultSelector?: object;
protected readonly branches: StateGraph[];
protected readonly queryLanguage?: QueryLanguage;
protected readonly outputs?: object;
protected readonly arguments?: object;
protected readonly assign?: object;
protected iteration?: StateGraph;
protected processorMode?: ProcessorMode;
protected processor?: StateGraph;
protected processorConfig?: ProcessorConfig;
protected defaultChoice?: State;
/**
* @internal
*/
protected _next?: State;
private readonly retries;
private readonly catches;
private readonly choices;
private readonly prefixes;
/**
* The graph that this state is part of.
*
* Used for guaranteeing consistency between graphs and graph components.
*/
private containingGraph?;
/**
* States with references to this state.
*
* Used for finding complete connected graph that a state is part of.
*/
private readonly incomingStates;
constructor(scope: Construct, id: string, props: StateProps);
/**
* Allows the state to validate itself.
*/
protected validateState(): string[];
get id(): string;
/**
* Tokenized string that evaluates to the state's ID
*/
get stateId(): string;
/**
* Add a prefix to the stateId of this state
*/
addPrefix(x: string): void;
/**
* Register this state as part of the given graph
*
* Don't call this. It will be called automatically when you work
* with states normally.
*/
bindToGraph(graph: StateGraph): void;
/**
* Render the state as JSON
*/
abstract toStateJson(stateMachineQueryLanguage?: QueryLanguage): object;
/**
* Add a retrier to the retry list of this state
* @internal
*/
protected _addRetry(props?: RetryProps): void;
/**
* Add an error handler to the catch list of this state
* @internal
*/
protected _addCatch(handler: State, props?: CatchProps): void;
/**
* Make the indicated state the default transition of this state
*/
protected makeNext(next: State): void;
/**
* Add a choice branch to this state
*/
protected addChoice(condition: Condition, next: State, options?: ChoiceTransitionOptions): void;
/**
* Add a parallel branch to this state
*/
protected addBranch(branch: StateGraph): void;
/**
* Add a map iterator to this state
*/
protected addIterator(iteration: StateGraph): void;
/**
* Add a item processor to this state
*/
protected addItemProcessor(processor: StateGraph, config?: ProcessorConfig): void;
/**
* Make the indicated state the default choice transition of this state
*/
protected makeDefault(def: State): void;
/**
* Render the default next state in ASL JSON format
*/
protected renderNextEnd(): any;
/**
* Render the choices in ASL JSON format
*/
protected renderChoices(topLevelQueryLanguage?: QueryLanguage): any;
/**
* Render InputPath/Parameters/OutputPath/Arguments/Output in ASL JSON format
*/
protected renderInputOutput(): any;
/**
* Render parallel branches in ASL JSON format
*/
protected renderBranches(): any;
/**
* Render map iterator in ASL JSON format
*/
protected renderIterator(): any;
/**
* Render error recovery options in ASL JSON format
*/
protected renderRetryCatch(topLevelQueryLanguage?: QueryLanguage): any;
/**
* Render ResultSelector in ASL JSON format
*/
protected renderResultSelector(): any;
/**
* Render ItemProcessor in ASL JSON format
*/
protected renderItemProcessor(): any;
/**
* Render ProcessorConfig in ASL JSON format
*/
private renderProcessorConfig;
/**
* Render QueryLanguage in ASL JSON format if needed.
*/
protected renderQueryLanguage(topLevelQueryLanguage?: QueryLanguage): any;
/**
* Render the assign in ASL JSON format
*/
protected renderAssign(topLevelQueryLanguage?: QueryLanguage): any;
/**
* Called whenever this state is bound to a graph
*
* Can be overridden by subclasses.
*/
protected whenBoundToGraph(graph: StateGraph): void;
/**
* Add a state to the incoming list
*/
private addIncoming;
/**
* Return all states this state can transition to
*/
private outgoingTransitions;
}
/**
* Options for finding reachable states
*/
export interface FindStateOptions {
/**
* Whether or not to follow error-handling transitions
*
* @default false
*/
readonly includeErrorHandlers?: boolean;
}
/**
* Options for Choice Transition
*/
export interface ChoiceTransitionOptions extends AssignableStateOptions {
/**
* An optional description for the choice transition
*
* @default No comment
*/
readonly comment?: string;
/**
* This option for JSONata only. When you use JSONPath, then the state ignores this property.
* Used to specify and transform output from the state.
* When specified, the value overrides the state output default.
* The output field accepts any JSON value (object, array, string, number, boolean, null).
* Any string value, including those inside objects or arrays,
* will be evaluated as JSONata if surrounded by {% %} characters.
* Output also accepts a JSONata expression directly.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-input-output-filtering.html
*
* @default - $states.result or $states.errorOutput
*/
readonly outputs?: any;
}
/**
* Render a list or return undefined for an empty list
*/
export declare function renderList<T>(xs: T[], mapFn: (x: T) => any, sortFn?: (a: T, b: T) => number): any;
/**
* Render JSON path, respecting the special value JsonPath.DISCARD
*/
export declare function renderJsonPath(jsonPath?: string): undefined | null | string;
/**
* @internal
*/
export declare function _getActualQueryLanguage(topLevelQueryLanguage?: QueryLanguage, stateLevelQueryLanguage?: QueryLanguage): QueryLanguage;
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,45 @@
import type { Construct } from 'constructs';
import type { JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import type { INextable } from '../types';
import { QueryLanguage } from '../types';
/**
* Properties for defining a Succeed state that using JSONPath
*/
export interface SucceedJsonPathProps extends StateBaseProps, JsonPathCommonOptions {
}
/**
* Properties for defining a Succeed state that using JSONata
*/
export interface SucceedJsonataProps extends StateBaseProps, JsonataCommonOptions {
}
/**
* Properties for defining a Succeed state
*/
export interface SucceedProps extends StateBaseProps, JsonPathCommonOptions, JsonataCommonOptions {
}
/**
* Define a Succeed state in the state machine
*
* Reaching a Succeed state terminates the state execution in success.
*/
export declare class Succeed extends State {
/**
* Define a Succeed state in the state machine
*
* Reaching a Succeed state terminates the state execution in success.
*/
static jsonPath(scope: Construct, id: string, props?: SucceedJsonPathProps): Succeed;
/**
* Define a Succeed state in the state machine
*
* Reaching a Succeed state terminates the state execution in success.
*/
static jsonata(scope: Construct, id: string, props?: SucceedJsonataProps): Succeed;
readonly endStates: INextable[];
constructor(scope: Construct, id: string, props?: SucceedProps);
/**
* Return the Amazon States Language object for this state
*/
toStateJson(queryLanguage?: QueryLanguage): object;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Succeed=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class Succeed extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Succeed",version:"2.252.0"};static jsonPath(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_SucceedJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Succeed(scope,id,props)}static jsonata(scope,id,props={}){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_SucceedJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Succeed(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}endStates=[];constructor(scope,id,props={}){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_SucceedProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Succeed),error}}toStateJson(queryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(queryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{Type:state_type_1().StateType.SUCCEED,...this.renderQueryLanguage(queryLanguage),Comment:this.comment,...this.renderInputOutput()}}}exports.Succeed=Succeed;

View File

@@ -0,0 +1,313 @@
import type { Construct } from 'constructs';
import type { AssignableStateOptions, JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import * as cloudwatch from '../../../aws-cloudwatch';
import * as iam from '../../../aws-iam';
import * as cdk from '../../../core';
import { Chain } from '../chain';
import type { StateGraph } from '../state-graph';
import type { Credentials } from '../task-credentials';
import type { CatchProps, IChainable, INextable, RetryProps } from '../types';
import { QueryLanguage } from '../types';
/**
* Base options for all task states
*/
export interface TaskStateBaseOptions {
/**
* Timeout for the task
*
* @default - None
* @deprecated use `taskTimeout`
*/
readonly timeout?: cdk.Duration;
/**
* Timeout for the task
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* @default - None
*/
readonly taskTimeout?: Timeout;
/**
* Timeout for the heartbeat
*
* @default - None
* @deprecated use `heartbeatTimeout`
*/
readonly heartbeat?: cdk.Duration;
/**
* Timeout for the heartbeat
*
* [disable-awslint:duration-prop-type] is needed because all props interface in
* aws-stepfunctions-tasks extend this interface
*
* @default - None
*/
readonly heartbeatTimeout?: Timeout;
/**
* AWS Step Functions integrates with services directly in the Amazon States Language.
* You can control these AWS services using service integration patterns.
*
* Depending on the AWS Service, the Service Integration Pattern availability will vary.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-supported-services.html
*
* @default - `IntegrationPattern.REQUEST_RESPONSE` for most tasks.
* `IntegrationPattern.RUN_JOB` for the following exceptions:
* `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and `EmrContainersStartJobRun`.
*
*/
readonly integrationPattern?: IntegrationPattern;
/**
* Credentials for an IAM Role that the State Machine assumes for executing the task.
* This enables cross-account resource invocations.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html
*
* @default - None (Task is executed using the State Machine's execution role)
*/
readonly credentials?: Credentials;
}
interface TaskStateJsonPathBaseOptions extends JsonPathCommonOptions {
/**
* JSONPath expression to indicate where to inject the state's output
*
* May also be the special value JsonPath.DISCARD, which will cause the state's
* input to become its output.
*
* @default $
*/
readonly resultPath?: string;
/**
* The JSON that will replace the state's raw result and become the effective
* result before ResultPath is applied.
*
* You can use ResultSelector to create a payload with values that are static
* or selected from the state's raw result.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/input-output-inputpath-params.html#input-output-resultselector
*
* @default - None
*/
readonly resultSelector?: {
[key: string]: any;
};
}
/**
* Props that are common to all tasks that using JSONPath
*/
export interface TaskStateJsonPathBaseProps extends StateBaseProps, TaskStateBaseOptions, AssignableStateOptions, TaskStateJsonPathBaseOptions {
}
/**
* Props that are common to all tasks that using JSONata
*/
export interface TaskStateJsonataBaseProps extends StateBaseProps, TaskStateBaseOptions, AssignableStateOptions, JsonataCommonOptions {
}
/**
* Props that are common to all tasks
*/
export interface TaskStateBaseProps extends StateBaseProps, TaskStateBaseOptions, AssignableStateOptions, TaskStateJsonPathBaseOptions, JsonataCommonOptions {
}
/**
* Define a Task state in the state machine
*
* Reaching a Task state causes some work to be executed, represented by the
* Task's resource property. Task constructs represent a generic Amazon
* States Language Task.
*
* For some resource types, more specific subclasses of Task may be available
* which are more convenient to use.
*/
export declare abstract class TaskStateBase extends State implements INextable {
readonly endStates: INextable[];
protected abstract readonly taskMetrics?: TaskMetricsConfig;
protected abstract readonly taskPolicies?: iam.PolicyStatement[];
private readonly timeout?;
private readonly taskTimeout?;
private readonly heartbeat?;
private readonly heartbeatTimeout?;
private readonly credentials?;
constructor(scope: Construct, id: string, props: TaskStateBaseProps);
/**
* Add retry configuration for this state
*
* This controls if and how the execution will be retried if a particular
* error occurs.
*/
addRetry(props?: RetryProps): TaskStateBase;
/**
* Add a recovery handler for this state
*
* When a particular error occurs, execution will continue at the error
* handler instead of failing the state machine execution.
*/
addCatch(handler: IChainable, props?: CatchProps): TaskStateBase;
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(topLevelQueryLanguage?: QueryLanguage): object;
/**
* Return the given named metric for this Task
*
* @default - sum over 5 minutes
*/
metric(metricName: string, props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* The interval, in milliseconds, between the time the Task starts and the time it closes.
*
* @default - average over 5 minutes
*/
metricRunTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* The interval, in milliseconds, for which the activity stays in the schedule state.
*
* @default - average over 5 minutes
*/
metricScheduleTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* The interval, in milliseconds, between the time the activity is scheduled and the time it closes.
*
* @default - average over 5 minutes
*/
metricTime(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity is scheduled
*
* @default - sum over 5 minutes
*/
metricScheduled(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity times out
*
* @default - sum over 5 minutes
*/
metricTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity is started
*
* @default - sum over 5 minutes
*/
metricStarted(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity succeeds
*
* @default - sum over 5 minutes
*/
metricSucceeded(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times this activity fails
*
* @default - sum over 5 minutes
*/
metricFailed(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
/**
* Metric for the number of times the heartbeat times out for this activity
*
* @default - sum over 5 minutes
*/
metricHeartbeatTimedOut(props?: cloudwatch.MetricOptions): cloudwatch.Metric;
protected whenBoundToGraph(graph: StateGraph): void;
/**
* @internal
*/
protected abstract _renderTask(topLevelQueryLanguage?: QueryLanguage): any;
/**
* @internal
*/
protected _renderParametersOrArguments(paramOrArg: any, queryLanguage: QueryLanguage): any;
private taskMetric;
private renderCredentials;
private renderTaskBase;
}
/**
* Task Metrics
*/
export interface TaskMetricsConfig {
/**
* Prefix for singular metric names of activity actions
*
* @default - No such metrics
*/
readonly metricPrefixSingular?: string;
/**
* Prefix for plural metric names of activity actions
*
* @default - No such metrics
*/
readonly metricPrefixPlural?: string;
/**
* The dimensions to attach to metrics
*
* @default - No metrics
*/
readonly metricDimensions?: cloudwatch.DimensionHash;
}
/**
*
* AWS Step Functions integrates with services directly in the Amazon States Language.
* You can control these AWS services using service integration patterns:
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html
*
*/
export declare enum IntegrationPattern {
/**
* Step Functions will wait for an HTTP response and then progress to the next state.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-default
*/
REQUEST_RESPONSE = "REQUEST_RESPONSE",
/**
* Step Functions can wait for a request to complete before progressing to the next state.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-sync
*/
RUN_JOB = "RUN_JOB",
/**
* Callback tasks provide a way to pause a workflow until a task token is returned.
* You must set a task token when using the callback pattern
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html#connect-wait-token
*/
WAIT_FOR_TASK_TOKEN = "WAIT_FOR_TASK_TOKEN"
}
/**
* Timeout for a task or heartbeat
*/
export declare abstract class Timeout {
/**
* Use a duration as timeout
*/
static duration(duration: cdk.Duration): Timeout;
/**
* Use a dynamic timeout specified by a JSONata expression.
*
* The JSONata expression value must be a positive integer.
*/
static jsonata(jsonataExpression: string): Timeout;
/**
* Use a dynamic timeout specified by a path in the state input.
*
* The path must select a field whose value is a positive integer.
*/
static at(path: string): Timeout;
/**
* Seconds for this timeout
*/
abstract readonly seconds?: number;
/**
* JSONata expression for this timeout
*/
abstract readonly jsonataExpression?: string;
/**
* Path for this timeout
*/
abstract readonly path?: string;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
import type { Construct } from 'constructs';
import { State } from './state';
import * as cloudwatch from '../../../aws-cloudwatch';
import * as cdk from '../../../core';
import { Chain } from '../chain';
import type { StateGraph } from '../state-graph';
import '../step-functions-task';
import type { CatchProps, IChainable, INextable, QueryLanguage, RetryProps } from '../types';

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Task=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},cloudwatch=()=>{var tmp=require("../../../aws-cloudwatch");return cloudwatch=()=>tmp,tmp},cdk=()=>{var tmp=require("../../../core");return cdk=()=>tmp,tmp},literal_string_1=()=>{var tmp=require("../../../core/lib/private/literal-string");return literal_string_1=()=>tmp,tmp},chain_1=()=>{var tmp=require("../chain");return chain_1=()=>tmp,tmp},fields_1=()=>{var tmp=require("../fields");return fields_1=()=>tmp,tmp},util_1=()=>{var tmp=require("../private/util");return util_1=()=>tmp,tmp};class Task extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Task",version:"2.252.0"};endStates;timeout;taskProps;constructor(scope,id,props){super(scope,id,props),this.timeout=props.timeout;const taskProps=props.task.bind(this);this.taskProps={...taskProps,parameters:(0,util_1().noEmptyObject)({...taskProps.parameters||{},...props.parameters||{}})},this.endStates=[this]}addRetry(props={}){return super._addRetry(props),this}addCatch(handler,props={}){return super._addCatch(handler.startState,props),this}next(next){return super.makeNext(next.startState),chain_1().Chain.sequence(this,next)}toStateJson(_){return{...this.renderNextEnd(),...this.renderRetryCatch(),...this.renderInputOutput(),Type:state_type_1().StateType.TASK,Comment:this.comment,Resource:this.taskProps.resourceArn,Parameters:this.taskProps.parameters&&fields_1().FieldUtils.renderObject(this.taskProps.parameters),ResultPath:(0,state_1().renderJsonPath)(this.resultPath),TimeoutSeconds:this.timeout&&this.timeout.toSeconds(),HeartbeatSeconds:this.taskProps.heartbeat&&this.taskProps.heartbeat.toSeconds()}}metric(metricName,props){return new(cloudwatch()).Metric({namespace:"AWS/States",metricName,dimensions:this.taskProps.metricDimensions,statistic:"sum",...props}).attachTo(this)}metricRunTime(props){return this.taskMetric(this.taskProps.metricPrefixSingular,"RunTime",{statistic:"avg",...props})}metricScheduleTime(props){return this.taskMetric(this.taskProps.metricPrefixSingular,"ScheduleTime",{statistic:"avg",...props})}metricTime(props){return this.taskMetric(this.taskProps.metricPrefixSingular,"Time",{statistic:"avg",...props})}metricScheduled(props){return this.taskMetric(this.taskProps.metricPrefixPlural,"Scheduled",props)}metricTimedOut(props){return this.taskMetric(this.taskProps.metricPrefixPlural,"TimedOut",props)}metricStarted(props){return this.taskMetric(this.taskProps.metricPrefixPlural,"Started",props)}metricSucceeded(props){return this.taskMetric(this.taskProps.metricPrefixPlural,"Succeeded",props)}metricFailed(props){return this.taskMetric(this.taskProps.metricPrefixPlural,"Failed",props)}metricHeartbeatTimedOut(props){return this.taskMetric(this.taskProps.metricPrefixPlural,"HeartbeatTimedOut",props)}whenBoundToGraph(graph){super.whenBoundToGraph(graph);for(const policyStatement of this.taskProps.policyStatements||[])graph.registerPolicyStatement(policyStatement)}taskMetric(prefix,suffix,props){if(prefix===void 0)throw new(cdk()).UnscopedValidationError((0,literal_string_1().lit)`TaskResourceDoesNotExposeMetrics`,"This Task Resource does not expose metrics");return this.metric(prefix+suffix,props)}}exports.Task=Task;

View File

@@ -0,0 +1,103 @@
import type { Construct } from 'constructs';
import type { AssignableStateOptions, JsonataCommonOptions, JsonPathCommonOptions, StateBaseProps } from './state';
import { State } from './state';
import type * as cdk from '../../../core';
import { Chain } from '../chain';
import type { IChainable, INextable } from '../types';
import { QueryLanguage } from '../types';
/**
* Represents the Wait state which delays a state machine from continuing for a specified time
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-wait-state.html
*/
export declare class WaitTime {
private readonly json;
/**
* Wait a fixed amount of time.
*/
static duration(duration: cdk.Duration): WaitTime;
/**
* Wait for a number of seconds stored in the state object from string.
* This method can use JSONata expression.
*
* If you want to use fixed value, we recommend using `WaitTime.duration()`
*
* Example value: `{% $waitSeconds %}`
*/
static seconds(seconds: string): WaitTime;
/**
* Wait until the given ISO8601 timestamp.
* This method can use JSONata expression.
*
* Example value: `2016-03-14T01:59:00Z`
*/
static timestamp(timestamp: string): WaitTime;
/**
* Wait for a number of seconds stored in the state object.
*
* Example value: `$.waitSeconds`
*/
static secondsPath(path: string): WaitTime;
/**
* Wait until a timestamp found in the state object.
*
* Example value: `$.waitTimestamp`
*/
static timestampPath(path: string): WaitTime;
private constructor();
/**
* @internal
*/
get _json(): any;
}
interface WaitOptions {
/**
* Wait duration.
*/
readonly time: WaitTime;
}
/**
* Properties for defining a Wait state that using JSONPath
*/
export interface WaitJsonPathProps extends StateBaseProps, AssignableStateOptions, WaitOptions, JsonPathCommonOptions {
}
/**
* Properties for defining a Wait state that using JSONata
*/
export interface WaitJsonataProps extends StateBaseProps, AssignableStateOptions, WaitOptions, JsonataCommonOptions {
}
/**
* Properties for defining a Wait state
*/
export interface WaitProps extends StateBaseProps, AssignableStateOptions, WaitOptions {
}
/**
* Define a Wait state in the state machine
*
* A Wait state can be used to delay execution of the state machine for a while.
*/
export declare class Wait extends State implements INextable {
/**
* Define a Wait state using JSONPath in the state machine
*
* A Wait state can be used to delay execution of the state machine for a while.
*/
static jsonPath(scope: Construct, id: string, props: WaitJsonPathProps): Wait;
/**
* Define a Wait state using JSONata in the state machine
*
* A Wait state can be used to delay execution of the state machine for a while.
*/
static jsonata(scope: Construct, id: string, props: WaitJsonataProps): Wait;
readonly endStates: INextable[];
private readonly time;
constructor(scope: Construct, id: string, props: WaitProps);
/**
* Continue normal execution with the given state
*/
next(next: IChainable): Chain;
/**
* Return the Amazon States Language object for this state
*/
toStateJson(topLevelQueryLanguage?: QueryLanguage): object;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Wait=exports.WaitTime=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var state_type_1=()=>{var tmp=require("./private/state-type");return state_type_1=()=>tmp,tmp},state_1=()=>{var tmp=require("./state");return state_1=()=>tmp,tmp},chain_1=()=>{var tmp=require("../chain");return chain_1=()=>tmp,tmp},types_1=()=>{var tmp=require("../types");return types_1=()=>tmp,tmp};class WaitTime{json;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.WaitTime",version:"2.252.0"};static duration(duration){try{jsiiDeprecationWarnings().aws_cdk_lib_Duration(duration)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.duration),error}return new WaitTime({Seconds:duration.toSeconds()})}static seconds(seconds){return new WaitTime({Seconds:seconds})}static timestamp(timestamp){return new WaitTime({Timestamp:timestamp})}static secondsPath(path){return new WaitTime({SecondsPath:path})}static timestampPath(path){return new WaitTime({TimestampPath:path})}constructor(json){this.json=json}get _json(){return this.json}}exports.WaitTime=WaitTime;class Wait extends state_1().State{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Wait",version:"2.252.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_WaitJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new Wait(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_WaitJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new Wait(scope,id,{...props,queryLanguage:types_1().QueryLanguage.JSONATA})}endStates;time;constructor(scope,id,props){super(scope,id,props);try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_WaitProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,Wait),error}this.time=props.time,this.endStates=[this]}next(next){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_IChainable(next)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.next),error}return super.makeNext(next.startState),chain_1().Chain.sequence(this,next)}toStateJson(topLevelQueryLanguage){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_QueryLanguage(topLevelQueryLanguage)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.toStateJson),error}return{Type:state_type_1().StateType.WAIT,...this.renderQueryLanguage(topLevelQueryLanguage),Comment:this.comment,...this.time._json,...this.renderInputOutput(),...this.renderNextEnd(),...this.renderAssign(topLevelQueryLanguage)}}}exports.Wait=Wait;

View File

@@ -0,0 +1,26 @@
import './states/task';
import type * as cloudwatch from '../../aws-cloudwatch';
import type * as iam from '../../aws-iam';
import type { Duration } from '../../core';
/**
* Three ways to call an integrated service: Request Response, Run a Job and Wait for a Callback with Task Token.
* @see https://docs.aws.amazon.com/step-functions/latest/dg/connect-to-resource.html
*
* Here, they are named as FIRE_AND_FORGET, SYNC and WAIT_FOR_TASK_TOKEN respectfully.
*
* @default FIRE_AND_FORGET
*/
export declare enum ServiceIntegrationPattern {
/**
* Call a service and progress to the next state immediately after the API call completes
*/
FIRE_AND_FORGET = "FIRE_AND_FORGET",
/**
* Call a service and wait for a job to complete.
*/
SYNC = "SYNC",
/**
* Call a service with a task token and wait until that token is returned by SendTaskSuccess/SendTaskFailure with payload.
*/
WAIT_FOR_TASK_TOKEN = "WAIT_FOR_TASK_TOKEN"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ServiceIntegrationPattern=void 0;var ServiceIntegrationPattern;(function(ServiceIntegrationPattern2){ServiceIntegrationPattern2.FIRE_AND_FORGET="FIRE_AND_FORGET",ServiceIntegrationPattern2.SYNC="SYNC",ServiceIntegrationPattern2.WAIT_FOR_TASK_TOKEN="WAIT_FOR_TASK_TOKEN"})(ServiceIntegrationPattern||(exports.ServiceIntegrationPattern=ServiceIntegrationPattern={}));

View File

@@ -0,0 +1,88 @@
export interface MetricWithDims<D> {
readonly namespace: string;
readonly metricName: string;
readonly statistic: string;
readonly dimensionsMap: D;
}
export declare class StatesMetrics {
static executionsAbortedSum(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static executionsFailedSum(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static executionsStartedSum(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static executionsSucceededSum(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static executionThrottledSum(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static executionsTimedOutSum(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static executionTimeAverage(this: void, dimensions: {
StateMachineArn: string;
}): MetricWithDims<{
StateMachineArn: string;
}>;
static activitiesFailedSum(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activitiesHeartbeatTimedOutSum(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activitiesScheduledSum(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activitiesStartedSum(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activitiesSucceededSum(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activitiesTimedOutSum(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activityRunTimeAverage(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activityScheduleTimeAverage(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
static activityTimeAverage(this: void, dimensions: {
ActivityArn: string;
}): MetricWithDims<{
ActivityArn: string;
}>;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StatesMetrics=void 0;class StatesMetrics{static executionsAbortedSum(dimensions){return{namespace:"AWS/States",metricName:"ExecutionsAborted",dimensionsMap:dimensions,statistic:"Sum"}}static executionsFailedSum(dimensions){return{namespace:"AWS/States",metricName:"ExecutionsFailed",dimensionsMap:dimensions,statistic:"Sum"}}static executionsStartedSum(dimensions){return{namespace:"AWS/States",metricName:"ExecutionsStarted",dimensionsMap:dimensions,statistic:"Sum"}}static executionsSucceededSum(dimensions){return{namespace:"AWS/States",metricName:"ExecutionsSucceeded",dimensionsMap:dimensions,statistic:"Sum"}}static executionThrottledSum(dimensions){return{namespace:"AWS/States",metricName:"ExecutionThrottled",dimensionsMap:dimensions,statistic:"Sum"}}static executionsTimedOutSum(dimensions){return{namespace:"AWS/States",metricName:"ExecutionsTimedOut",dimensionsMap:dimensions,statistic:"Sum"}}static executionTimeAverage(dimensions){return{namespace:"AWS/States",metricName:"ExecutionTime",dimensionsMap:dimensions,statistic:"Average"}}static activitiesFailedSum(dimensions){return{namespace:"AWS/States",metricName:"ActivitiesFailed",dimensionsMap:dimensions,statistic:"Sum"}}static activitiesHeartbeatTimedOutSum(dimensions){return{namespace:"AWS/States",metricName:"ActivitiesHeartbeatTimedOut",dimensionsMap:dimensions,statistic:"Sum"}}static activitiesScheduledSum(dimensions){return{namespace:"AWS/States",metricName:"ActivitiesScheduled",dimensionsMap:dimensions,statistic:"Sum"}}static activitiesStartedSum(dimensions){return{namespace:"AWS/States",metricName:"ActivitiesStarted",dimensionsMap:dimensions,statistic:"Sum"}}static activitiesSucceededSum(dimensions){return{namespace:"AWS/States",metricName:"ActivitiesSucceeded",dimensionsMap:dimensions,statistic:"Sum"}}static activitiesTimedOutSum(dimensions){return{namespace:"AWS/States",metricName:"ActivitiesTimedOut",dimensionsMap:dimensions,statistic:"Sum"}}static activityRunTimeAverage(dimensions){return{namespace:"AWS/States",metricName:"ActivityRunTime",dimensionsMap:dimensions,statistic:"Average"}}static activityScheduleTimeAverage(dimensions){return{namespace:"AWS/States",metricName:"ActivityScheduleTime",dimensionsMap:dimensions,statistic:"Average"}}static activityTimeAverage(dimensions){return{namespace:"AWS/States",metricName:"ActivityTime",dimensionsMap:dimensions,statistic:"Average"}}}exports.StatesMetrics=StatesMetrics;

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,45 @@
import type * as iam from '../../aws-iam';
/**
* Specifies a target role assumed by the State Machine's execution role for invoking the task's resource.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields
*/
export interface Credentials {
/**
* The role to be assumed for executing the Task.
*/
readonly role: TaskRole;
}
/**
* Role to be assumed by the State Machine's execution role for invoking a task's resource.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html
* @see https://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-task-state.html#task-state-fields
*/
export declare abstract class TaskRole {
/**
* Construct a task role retrieved from task inputs using a json expression
*
* @param expression json expression to roleArn
*
* @example
*
* sfn.TaskRole.fromRoleArnJsonPath('$.RoleArn');
*/
static fromRoleArnJsonPath(expression: string): TaskRole;
/**
* Construct a task role based on the provided IAM Role
*
* @param role IAM Role
*/
static fromRole(role: iam.IRole): TaskRole;
/**
* Retrieves the roleArn for this TaskRole
*/
abstract readonly roleArn: string;
/**
* Retrieves the resource for use in IAM Policies for this TaskRole
*/
abstract readonly resource: string;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TaskRole=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var fields_1=()=>{var tmp=require("./fields");return fields_1=()=>tmp,tmp};class TaskRole{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.TaskRole",version:"2.252.0"};static fromRoleArnJsonPath(expression){return new JsonExpressionTaskRole(expression)}static fromRole(role){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_iam_IRole(role)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.fromRole),error}return new IamRoleTaskRole(role)}}exports.TaskRole=TaskRole;class JsonExpressionTaskRole extends TaskRole{resource;roleArn;constructor(expression){super(),this.roleArn=fields_1().JsonPath.stringAt(expression),this.resource="*"}}class IamRoleTaskRole extends TaskRole{resource;roleArn;constructor(role){super(),this.roleArn=role.roleArn,this.resource=role.roleArn}}

View File

@@ -0,0 +1,257 @@
import type { Chain } from './chain';
import type { State } from './states/state';
import type { Duration } from '../../core';
/**
* Interface for states that can have 'next' states
*/
export interface INextable {
/**
* Go to the indicated state after this state
*
* @returns The chain of states built up
*/
next(state: IChainable): Chain;
}
/**
* Interface for objects that can be used in a Chain
*/
export interface IChainable {
/**
* Descriptive identifier for this chainable
*/
readonly id: string;
/**
* The start state of this chainable
*/
readonly startState: State;
/**
* The chainable end state(s) of this chainable
*/
readonly endStates: INextable[];
}
/**
* Values allowed in the retrier JitterStrategy field
*/
export declare enum JitterType {
/**
* Calculates the delay to be a random number between 0 and the computed backoff for the given retry attempt count
*/
FULL = "FULL",
/**
* Calculates the delay to be the computed backoff for the given retry attempt count (equivalent to if Jitter was not declared - i.e. the default value)
*/
NONE = "NONE"
}
/**
* Predefined error strings
* Error names in Amazon States Language - https://states-language.net/spec.html#appendix-a
* Error handling in Step Functions - https://docs.aws.amazon.com/step-functions/latest/dg/concepts-error-handling.html
*/
export declare class Errors {
/**
* Matches any Error.
*/
static readonly ALL = "States.ALL";
/**
* A Task State failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
*/
static readonly HEARTBEAT_TIMEOUT = "States.HeartbeatTimeout";
/**
* A Task State either ran longer than the “TimeoutSeconds” value, or
* failed to heartbeat for a time longer than the “HeartbeatSeconds” value.
*/
static readonly TIMEOUT = "States.Timeout";
/**
* A Task State failed during the execution.
*/
static readonly TASKS_FAILED = "States.TaskFailed";
/**
* A Task State failed because it had insufficient privileges to execute
* the specified code.
*/
static readonly PERMISSIONS = "States.Permissions";
/**
* A Task States “ResultPath” field cannot be applied to the input the state received.
*/
static readonly RESULT_PATH_MATCH_FAILURE = "States.ResultPathMatchFailure";
/**
* Within a states “Parameters” field, the attempt to replace a field whose
* name ends in “.$” using a Path failed.
*/
static readonly PARAMETER_PATH_FAILURE = "States.ParameterPathFailure";
/**
* A branch of a Parallel state failed.
*/
static readonly BRANCH_FAILED = "States.BranchFailed";
/**
* A Choice state failed to find a match for the condition field extracted
* from its input.
*/
static readonly NO_CHOICE_MATCHED = "States.NoChoiceMatched";
}
/**
* Retry details
*/
export interface RetryProps {
/**
* Errors to retry
*
* A list of error strings to retry, which can be either predefined errors
* (for example Errors.NoChoiceMatched) or a self-defined error.
*
* @default All errors
*/
readonly errors?: string[];
/**
* How many seconds to wait initially before retrying
*
* @default Duration.seconds(1)
*/
readonly interval?: Duration;
/**
* How many times to retry this particular error.
*
* May be 0 to disable retry for specific errors (in case you have
* a catch-all retry policy).
*
* @default 3
*/
readonly maxAttempts?: number;
/**
* Maximum limit on retry interval growth during exponential backoff.
*
* @default - No max delay
*/
readonly maxDelay?: Duration;
/**
* Introduces a randomization over the retry interval.
*
* @default - No jitter strategy
*/
readonly jitterStrategy?: JitterType;
/**
* Multiplication for how much longer the wait interval gets on every retry
*
* @default 2
*/
readonly backoffRate?: number;
}
/**
* Error handler details
*/
export interface CatchProps {
/**
* Errors to recover from by going to the given state
*
* A list of error strings to retry, which can be either predefined errors
* (for example Errors.NoChoiceMatched) or a self-defined error.
*
* @default All errors
*/
readonly errors?: string[];
/**
* JSONPath expression to indicate where to inject the error data
*
* May also be the special value JsonPath.DISCARD, which will cause the error
* data to be discarded.
*
* @default $
*/
readonly resultPath?: string;
/**
* This option for JSONata only. When you use JSONPath, then the state ignores this property.
* Used to specify and transform output from the state.
* When specified, the value overrides the state output default.
* The output field accepts any JSON value (object, array, string, number, boolean, null).
* Any string value, including those inside objects or arrays,
* will be evaluated as JSONata if surrounded by {% %} characters.
* Output also accepts a JSONata expression directly.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/concepts-input-output-filtering.html
*
* @default - $states.result or $states.errorOutput
*/
readonly outputs?: any;
/**
* Workflow variables to store in this step.
* Using workflow variables, you can store data in a step and retrieve that data in future steps.
*
* @see
* https://docs.aws.amazon.com/step-functions/latest/dg/workflow-variables.html
*
* @default - Not assign variables
*/
readonly assign?: {
[name: string]: any;
};
}
/**
* Mode of the Map workflow.
*/
export declare enum ProcessorMode {
/**
* Inline Map mode.
*/
INLINE = "INLINE",
/**
* Distributed Map mode.
*/
DISTRIBUTED = "DISTRIBUTED"
}
/**
* Execution type for the Map workflow.
*/
export declare enum ProcessorType {
/**
* Standard execution type.
*/
STANDARD = "STANDARD",
/**
* Express execution type.
*/
EXPRESS = "EXPRESS"
}
/**
* Specifies the configuration for the processor Map state.
*/
export interface ProcessorConfig {
/**
* Specifies the execution mode for the Map workflow.
*
* @default - ProcessorMode.INLINE if using the `Map` class, ProcessorMode.DISTRIBUTED if using the `DistributedMap` class
*/
readonly mode?: ProcessorMode;
/**
* Specifies the execution type for the Map workflow.
*
* If you use the `Map` class, you must provide this field if you specified `DISTRIBUTED` for the `mode` sub-field.
*
* If you use the `DistributedMap` class, this property is ignored.
* Use the `mapExecutionType` in the `DistributedMap` class instead.
*
* @default - no execution type
*/
readonly executionType?: ProcessorType;
}
/**
* Special string value to discard state input, output or result
* @deprecated use JsonPath.DISCARD
*/
export declare const DISCARD = "DISCARD";
/**
* The name of the query language used by the state machine or state.
*
* @see https://docs.aws.amazon.com/step-functions/latest/dg/transforming-data.html
*
* @default JSON_PATH
*/
export declare enum QueryLanguage {
/**
* Use JSONPath
*/
JSON_PATH = "JSONPath",
/**
* Use JSONata
*/
JSONATA = "JSONata"
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.QueryLanguage=exports.DISCARD=exports.ProcessorType=exports.ProcessorMode=exports.Errors=exports.JitterType=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var JitterType;(function(JitterType2){JitterType2.FULL="FULL",JitterType2.NONE="NONE"})(JitterType||(exports.JitterType=JitterType={}));class Errors{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions.Errors",version:"2.252.0"};static ALL="States.ALL";static HEARTBEAT_TIMEOUT="States.HeartbeatTimeout";static TIMEOUT="States.Timeout";static TASKS_FAILED="States.TaskFailed";static PERMISSIONS="States.Permissions";static RESULT_PATH_MATCH_FAILURE="States.ResultPathMatchFailure";static PARAMETER_PATH_FAILURE="States.ParameterPathFailure";static BRANCH_FAILED="States.BranchFailed";static NO_CHOICE_MATCHED="States.NoChoiceMatched"}exports.Errors=Errors;var ProcessorMode;(function(ProcessorMode2){ProcessorMode2.INLINE="INLINE",ProcessorMode2.DISTRIBUTED="DISTRIBUTED"})(ProcessorMode||(exports.ProcessorMode=ProcessorMode={}));var ProcessorType;(function(ProcessorType2){ProcessorType2.STANDARD="STANDARD",ProcessorType2.EXPRESS="EXPRESS"})(ProcessorType||(exports.ProcessorType=ProcessorType={})),exports.DISCARD="DISCARD";var QueryLanguage;(function(QueryLanguage2){QueryLanguage2.JSON_PATH="JSONPath",QueryLanguage2.JSONATA="JSONata"})(QueryLanguage||(exports.QueryLanguage=QueryLanguage={}));