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,113 @@
import type { Construct } from 'constructs';
import type { DynamoAttributeValue, DynamoConsumedCapacity, DynamoItemCollectionMetrics, DynamoReturnValues } from './shared-types';
import type * as ddb from '../../../aws-dynamodb';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
interface DynamoDeleteItemOptions {
/**
* The name of the table containing the requested item.
*/
readonly table: ddb.ITableRef;
/**
* Primary key of the item to retrieve.
*
* For the primary key, you must provide all of the attributes.
* For example, with a simple primary key, you only need to provide a value for the partition key.
* For a composite primary key, you must provide values for both the partition key and the sort key.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-Key
*/
readonly key: {
[key: string]: DynamoAttributeValue;
};
/**
* A condition that must be satisfied in order for a conditional DeleteItem to succeed.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ConditionExpression
*
* @default - No condition expression
*/
readonly conditionExpression?: string;
/**
* One or more substitution tokens for attribute names in an expression
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ExpressionAttributeNames
*
* @default - No expression attribute names
*/
readonly expressionAttributeNames?: {
[key: string]: string;
};
/**
* One or more values that can be substituted in an expression.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ExpressionAttributeValues
*
* @default - No expression attribute values
*/
readonly expressionAttributeValues?: {
[key: string]: DynamoAttributeValue;
};
/**
* Determines the level of detail about provisioned throughput consumption that is returned in the response
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ReturnConsumedCapacity
*
* @default DynamoConsumedCapacity.NONE
*/
readonly returnConsumedCapacity?: DynamoConsumedCapacity;
/**
* Determines whether item collection metrics are returned.
* If set to SIZE, the response includes statistics about item collections, if any,
* that were modified during the operation are returned in the response.
* If set to NONE (the default), no statistics are returned.
*
* @default DynamoItemCollectionMetrics.NONE
*/
readonly returnItemCollectionMetrics?: DynamoItemCollectionMetrics;
/**
* Use ReturnValues if you want to get the item attributes as they appeared before they were deleted.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html#DDB-DeleteItem-request-ReturnValues
*
* @default DynamoReturnValues.NONE
*/
readonly returnValues?: DynamoReturnValues;
}
/**
* Properties for DynamoDeleteItem Task using JSONPath
*/
export interface DynamoDeleteItemJsonPathProps extends sfn.TaskStateJsonPathBaseProps, DynamoDeleteItemOptions {
}
/**
* Properties for DynamoDeleteItem Task using JSONata
*/
export interface DynamoDeleteItemJsonataProps extends sfn.TaskStateJsonataBaseProps, DynamoDeleteItemOptions {
}
/**
* Properties for DynamoDeleteItem Task
*/
export interface DynamoDeleteItemProps extends sfn.TaskStateBaseProps, DynamoDeleteItemOptions {
}
/**
* A StepFunctions task to call DynamoDeleteItem
*/
export declare class DynamoDeleteItem extends sfn.TaskStateBase {
private readonly props;
/**
* A StepFunctions task to call DynamoDeleteItem using JSONPath
*/
static jsonPath(scope: Construct, id: string, props: DynamoDeleteItemJsonPathProps): DynamoDeleteItem;
/**
* A StepFunctions task to call DynamoDeleteItem using JSONata
*/
static jsonata(scope: Construct, id: string, props: DynamoDeleteItemJsonataProps): DynamoDeleteItem;
protected readonly taskMetrics?: sfn.TaskMetricsConfig;
protected readonly taskPolicies?: iam.PolicyStatement[];
constructor(scope: Construct, id: string, props: DynamoDeleteItemProps);
/**
* @internal
*/
protected _renderTask(topLevelQueryLanguage?: sfn.QueryLanguage): any;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamoDeleteItem=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};class DynamoDeleteItem extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.DynamoDeleteItem",version:"2.252.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoDeleteItemJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new DynamoDeleteItem(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoDeleteItemJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new DynamoDeleteItem(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}taskMetrics;taskPolicies;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoDeleteItemProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,DynamoDeleteItem),error}this.taskPolicies=[new(iam()).PolicyStatement({resources:[core_1().Stack.of(this).formatArn({service:"dynamodb",resource:"table",resourceName:props.table.tableRef.tableName})],actions:[`dynamodb:${utils_1().DynamoMethod.DELETE}Item`]})]}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage);return{Resource:(0,utils_1().getDynamoResourceArn)(utils_1().DynamoMethod.DELETE),...this._renderParametersOrArguments({Key:(0,utils_1().transformAttributeValueMap)(this.props.key),TableName:this.props.table.tableRef.tableName,ConditionExpression:this.props.conditionExpression,ExpressionAttributeNames:this.props.expressionAttributeNames,ExpressionAttributeValues:(0,utils_1().transformAttributeValueMap)(this.props.expressionAttributeValues),ReturnConsumedCapacity:this.props.returnConsumedCapacity,ReturnItemCollectionMetrics:this.props.returnItemCollectionMetrics,ReturnValues:this.props.returnValues},queryLanguage)}}}exports.DynamoDeleteItem=DynamoDeleteItem;

View File

@@ -0,0 +1,96 @@
import type { Construct } from 'constructs';
import type { DynamoAttributeValue, DynamoConsumedCapacity, DynamoProjectionExpression } from './shared-types';
import type * as ddb from '../../../aws-dynamodb';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
interface DynamoGetItemOptions {
/**
* The name of the table containing the requested item.
*/
readonly table: ddb.ITableRef;
/**
* Primary key of the item to retrieve.
*
* For the primary key, you must provide all of the attributes.
* For example, with a simple primary key, you only need to provide a value for the partition key.
* For a composite primary key, you must provide values for both the partition key and the sort key.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-Key
*/
readonly key: {
[key: string]: DynamoAttributeValue;
};
/**
* Determines the read consistency model:
* If set to true, then the operation uses strongly consistent reads;
* otherwise, the operation uses eventually consistent reads.
*
* @default false
*/
readonly consistentRead?: boolean;
/**
* One or more substitution tokens for attribute names in an expression
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-ExpressionAttributeNames
*
* @default - No expression attributes
*/
readonly expressionAttributeNames?: {
[key: string]: string;
};
/**
* An array of DynamoProjectionExpression that identifies one or more attributes to retrieve from the table.
* These attributes can include scalars, sets, or elements of a JSON document.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-ProjectionExpression
*
* @default - No projection expression
*/
readonly projectionExpression?: DynamoProjectionExpression[];
/**
* Determines the level of detail about provisioned throughput consumption that is returned in the response
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-ReturnConsumedCapacity
*
* @default DynamoConsumedCapacity.NONE
*/
readonly returnConsumedCapacity?: DynamoConsumedCapacity;
}
/**
* Properties for DynamoGetItem Task using JSONPath
*/
export interface DynamoGetItemJsonPathProps extends sfn.TaskStateJsonPathBaseProps, DynamoGetItemOptions {
}
/**
* Properties for DynamoGetItem Task using JSONata
*/
export interface DynamoGetItemJsonataProps extends sfn.TaskStateJsonataBaseProps, DynamoGetItemOptions {
}
/**
* Properties for DynamoGetItem Task
*/
export interface DynamoGetItemProps extends sfn.TaskStateBaseProps, DynamoGetItemOptions {
}
/**
* A StepFunctions task to call DynamoGetItem
*/
export declare class DynamoGetItem extends sfn.TaskStateBase {
private readonly props;
/**
* A StepFunctions task using JSONPath to call DynamoGetItem
*/
static jsonPath(scope: Construct, id: string, props: DynamoGetItemJsonPathProps): DynamoGetItem;
/**
* A StepFunctions task using JSONata to call DynamoGetItem
*/
static jsonata(scope: Construct, id: string, props: DynamoGetItemJsonataProps): DynamoGetItem;
protected readonly taskMetrics?: sfn.TaskMetricsConfig;
protected readonly taskPolicies?: iam.PolicyStatement[];
constructor(scope: Construct, id: string, props: DynamoGetItemProps);
/**
* @internal
*/
protected _renderTask(topLevelQueryLanguage?: sfn.QueryLanguage): any;
private configureProjectionExpression;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamoGetItem=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};class DynamoGetItem extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.DynamoGetItem",version:"2.252.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoGetItemJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new DynamoGetItem(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoGetItemJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new DynamoGetItem(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}taskMetrics;taskPolicies;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoGetItemProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,DynamoGetItem),error}this.taskPolicies=[new(iam()).PolicyStatement({resources:[core_1().Stack.of(this).formatArn({service:"dynamodb",resource:"table",resourceName:props.table.tableRef.tableName})],actions:[`dynamodb:${utils_1().DynamoMethod.GET}Item`]})]}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage);return{Resource:(0,utils_1().getDynamoResourceArn)(utils_1().DynamoMethod.GET),...this._renderParametersOrArguments({Key:(0,utils_1().transformAttributeValueMap)(this.props.key),TableName:this.props.table.tableRef.tableName,ConsistentRead:this.props.consistentRead??!1,ExpressionAttributeNames:this.props.expressionAttributeNames,ProjectionExpression:this.configureProjectionExpression(this.props.projectionExpression),ReturnConsumedCapacity:this.props.returnConsumedCapacity},queryLanguage)}}configureProjectionExpression(expressions){return expressions?expressions.map(expression=>expression.toString()).join(","):void 0}}exports.DynamoGetItem=DynamoGetItem;

View File

@@ -0,0 +1,13 @@
import type { DynamoAttributeValue } from '../shared-types';
export declare enum DynamoMethod {
GET = "Get",
PUT = "Put",
DELETE = "Delete",
UPDATE = "Update"
}
export declare function getDynamoResourceArn(method: DynamoMethod): string;
export declare function transformAttributeValueMap(attrMap?: {
[key: string]: DynamoAttributeValue;
}): any;
export declare function validateJsonPath(value: string): void;
export declare function validateJsonata(value: string): void;

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamoMethod=void 0,exports.getDynamoResourceArn=getDynamoResourceArn,exports.transformAttributeValueMap=transformAttributeValueMap,exports.validateJsonPath=validateJsonPath,exports.validateJsonata=validateJsonata;var sfn=()=>{var tmp=require("../../../../aws-stepfunctions");return sfn=()=>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},task_utils_1=()=>{var tmp=require("../../private/task-utils");return task_utils_1=()=>tmp,tmp},DynamoMethod;(function(DynamoMethod2){DynamoMethod2.GET="Get",DynamoMethod2.PUT="Put",DynamoMethod2.DELETE="Delete",DynamoMethod2.UPDATE="Update"})(DynamoMethod||(exports.DynamoMethod=DynamoMethod={}));function getDynamoResourceArn(method){return(0,task_utils_1().integrationResourceArn)("dynamodb",`${method.toLowerCase()}Item`,sfn().IntegrationPattern.REQUEST_RESPONSE)}function transformAttributeValueMap(attrMap){const transformedValue={};for(const key in attrMap)key&&(transformedValue[key]=attrMap[key].toObject());return attrMap?transformedValue:void 0}function validateJsonPath(value){if(!value.startsWith("$"))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`DataJsonPathValues`,"Data JSON path values must either be exactly equal to '$' or start with '$.'")}function validateJsonata(value){if(!value.startsWith("{%")||!value.endsWith("%}"))throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`DataJsonataExpressionValues`,"Data JSONata expression values must either be exactly start with '{%' and end with '%}'")}

View File

@@ -0,0 +1,111 @@
import type { Construct } from 'constructs';
import type { DynamoAttributeValue, DynamoConsumedCapacity, DynamoItemCollectionMetrics, DynamoReturnValues } from './shared-types';
import type * as ddb from '../../../aws-dynamodb';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
interface DynamoPutItemOptions {
/**
* A map of attribute name/value pairs, one for each attribute.
* Only the primary key attributes are required;
* you can optionally provide other attribute name-value pairs for the item.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-Item
*/
readonly item: {
[key: string]: DynamoAttributeValue;
};
/**
* The name of the table where the item should be written .
*/
readonly table: ddb.ITableRef;
/**
* A condition that must be satisfied in order for a conditional PutItem operation to succeed.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-ConditionExpression
*
* @default - No condition expression
*/
readonly conditionExpression?: string;
/**
* One or more substitution tokens for attribute names in an expression
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-ExpressionAttributeNames
*
* @default - No expression attribute names
*/
readonly expressionAttributeNames?: {
[key: string]: string;
};
/**
* One or more values that can be substituted in an expression.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-ExpressionAttributeValues
*
* @default - No expression attribute values
*/
readonly expressionAttributeValues?: {
[key: string]: DynamoAttributeValue;
};
/**
* Determines the level of detail about provisioned throughput consumption that is returned in the response
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-ReturnConsumedCapacity
*
* @default DynamoConsumedCapacity.NONE
*/
readonly returnConsumedCapacity?: DynamoConsumedCapacity;
/**
* The item collection metrics to returned in the response
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LSI.html#LSI.ItemCollections
*
* @default DynamoItemCollectionMetrics.NONE
*/
readonly returnItemCollectionMetrics?: DynamoItemCollectionMetrics;
/**
* Use ReturnValues if you want to get the item attributes as they appeared
* before they were updated with the PutItem request.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#DDB-PutItem-request-ReturnValues
*
* @default DynamoReturnValues.NONE
*/
readonly returnValues?: DynamoReturnValues;
}
/**
* Properties for DynamoPutItem Task using JSONPath
*/
export interface DynamoPutItemJsonPathProps extends sfn.TaskStateJsonPathBaseProps, DynamoPutItemOptions {
}
/**
* Properties for DynamoPutItem Task using JSONata
*/
export interface DynamoPutItemJsonataProps extends sfn.TaskStateJsonataBaseProps, DynamoPutItemOptions {
}
/**
* Properties for DynamoPutItem Task
*/
export interface DynamoPutItemProps extends sfn.TaskStateBaseProps, DynamoPutItemOptions {
}
/**
* A StepFunctions task to call DynamoPutItem
*/
export declare class DynamoPutItem extends sfn.TaskStateBase {
private readonly props;
/**
* A StepFunctions task using JSONPath to call DynamoPutItem
*/
static jsonPath(scope: Construct, id: string, props: DynamoPutItemJsonPathProps): DynamoPutItem;
/**
* A StepFunctions task using JSONata to call DynamoPutItem
*/
static jsonata(scope: Construct, id: string, props: DynamoPutItemJsonataProps): DynamoPutItem;
protected readonly taskMetrics?: sfn.TaskMetricsConfig;
protected readonly taskPolicies?: iam.PolicyStatement[];
constructor(scope: Construct, id: string, props: DynamoPutItemProps);
/**
* @internal
*/
protected _renderTask(topLevelQueryLanguage?: sfn.QueryLanguage): any;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamoPutItem=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};class DynamoPutItem extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.DynamoPutItem",version:"2.252.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoPutItemJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new DynamoPutItem(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoPutItemJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new DynamoPutItem(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}taskMetrics;taskPolicies;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoPutItemProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,DynamoPutItem),error}this.taskPolicies=[new(iam()).PolicyStatement({resources:[core_1().Stack.of(this).formatArn({service:"dynamodb",resource:"table",resourceName:props.table.tableRef.tableName})],actions:[`dynamodb:${utils_1().DynamoMethod.PUT}Item`]})]}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage);return{Resource:(0,utils_1().getDynamoResourceArn)(utils_1().DynamoMethod.PUT),...this._renderParametersOrArguments({Item:(0,utils_1().transformAttributeValueMap)(this.props.item),TableName:this.props.table.tableRef.tableName,ConditionExpression:this.props.conditionExpression,ExpressionAttributeNames:this.props.expressionAttributeNames,ExpressionAttributeValues:(0,utils_1().transformAttributeValueMap)(this.props.expressionAttributeValues),ReturnConsumedCapacity:this.props.returnConsumedCapacity,ReturnItemCollectionMetrics:this.props.returnItemCollectionMetrics,ReturnValues:this.props.returnValues},queryLanguage)}}}exports.DynamoPutItem=DynamoPutItem;

View File

@@ -0,0 +1,209 @@
/**
* Determines the level of detail about provisioned throughput consumption that is returned.
*/
export declare enum DynamoConsumedCapacity {
/**
* The response includes the aggregate ConsumedCapacity for the operation,
* together with ConsumedCapacity for each table and secondary index that was accessed
*/
INDEXES = "INDEXES",
/**
* The response includes only the aggregate ConsumedCapacity for the operation.
*/
TOTAL = "TOTAL",
/**
* No ConsumedCapacity details are included in the response.
*/
NONE = "NONE"
}
/**
* Determines whether item collection metrics are returned.
*/
export declare enum DynamoItemCollectionMetrics {
/**
* If set to SIZE, the response includes statistics about item collections,
* if any, that were modified during the operation.
*/
SIZE = "SIZE",
/**
* If set to NONE, no statistics are returned.
*/
NONE = "NONE"
}
/**
* Use ReturnValues if you want to get the item attributes as they appear before or after they are changed
*/
export declare enum DynamoReturnValues {
/**
* Nothing is returned
*/
NONE = "NONE",
/**
* Returns all of the attributes of the item
*/
ALL_OLD = "ALL_OLD",
/**
* Returns only the updated attributes
*/
UPDATED_OLD = "UPDATED_OLD",
/**
* Returns all of the attributes of the item
*/
ALL_NEW = "ALL_NEW",
/**
* Returns only the updated attributes
*/
UPDATED_NEW = "UPDATED_NEW"
}
/**
* Class to generate projection expression
*/
export declare class DynamoProjectionExpression {
private expression;
/**
* Adds the passed attribute to the chain
*
* @param attr Attribute name
*/
withAttribute(attr: string): DynamoProjectionExpression;
/**
* Adds the array literal access for passed index
*
* @param index array index
*/
atIndex(index: number): DynamoProjectionExpression;
/**
* converts and return the string expression
*/
toString(): string;
}
/**
* Represents the data for an attribute.
* Each attribute value is described as a name-value pair.
* The name is the data type, and the value is the data itself.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeValue.html
*/
export declare class DynamoAttributeValue {
/**
* Sets an attribute of type String. For example: "S": "Hello"
* Strings may be literal values or as JSONata expression or as JsonPath. Example values:
*
* - `DynamoAttributeValue.fromString('someValue')`
* - `DynamoAttributeValue.fromString('{% $bar %}')`
* - `DynamoAttributeValue.fromString(JsonPath.stringAt('$.bar'))`
*/
static fromString(value: string): DynamoAttributeValue;
/**
* Sets a literal number. For example: 1234
* Numbers are sent across the network to DynamoDB as strings,
* to maximize compatibility across languages and libraries.
* However, DynamoDB treats them as number type attributes for mathematical operations.
*/
static fromNumber(value: number): DynamoAttributeValue;
/**
* Sets an attribute of type Number. For example: "N": "123.45"
* Numbers are sent across the network to DynamoDB as strings,
* to maximize compatibility across languages and libraries.
* However, DynamoDB treats them as number type attributes for mathematical operations.
*
* Numbers may be expressed as literal strings or as JSONata expression or as JsonPath
*/
static numberFromString(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type Binary. For example: "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk"
*
* @param value base-64 encoded string
*/
static fromBinary(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type String Set. For example: "SS": ["Giraffe", "Hippo" ,"Zebra"]
*/
static fromStringSet(value: string[]): DynamoAttributeValue;
/**
* Sets an attribute of type Number Set. For example: "NS": ["42.2", "-19", "7.5", "3.14"]
* Numbers are sent across the network to DynamoDB as strings,
* to maximize compatibility across languages and libraries.
* However, DynamoDB treats them as number type attributes for mathematical operations.
*/
static fromNumberSet(value: number[]): DynamoAttributeValue;
/**
* Sets an attribute of type Number Set. For example: "NS": ["42.2", "-19", "7.5", "3.14"]
* Numbers are sent across the network to DynamoDB as strings,
* to maximize compatibility across languages and libraries.
* However, DynamoDB treats them as number type attributes for mathematical operations.
*
* Numbers may be expressed as literal strings or as JsonPath
*/
static numberSetFromStrings(value: string[]): DynamoAttributeValue;
/**
* Sets an attribute of type Binary Set. For example: "BS": ["U3Vubnk=", "UmFpbnk=", "U25vd3k="]
*/
static fromBinarySet(value: string[]): DynamoAttributeValue;
/**
* Sets an attribute of type Map. For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*/
static fromMap(value: {
[key: string]: DynamoAttributeValue;
}): DynamoAttributeValue;
/**
* Sets an attribute of type Map. For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* @param value JSONata expression that specifies state input to be used
*/
static mapFromJsonata(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type Map. For example: "M": {"Name": {"S": "Joe"}, "Age": {"N": "35"}}
*
* @param value Json path that specifies state input to be used
*/
static mapFromJsonPath(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type List. For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"N", "3.14159"}]
*/
static fromList(value: DynamoAttributeValue[]): DynamoAttributeValue;
/**
* Sets an attribute of type List. For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"S", "Veggies"}]
*
* @param value JSONata expression that specifies state input to be used
*/
static listFromJsonata(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type List. For example: "L": [ {"S": "Cookies"} , {"S": "Coffee"}, {"S", "Veggies"}]
*
* @param value Json path that specifies state input to be used
*/
static listFromJsonPath(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type Null. For example: "NULL": true
*/
static fromNull(value: boolean): DynamoAttributeValue;
/**
* Sets an attribute of type Boolean. For example: "BOOL": true
*/
static fromBoolean(value: boolean): DynamoAttributeValue;
/**
* Sets an attribute of type Boolean from state input through JSONata expression.
* For example: "BOOL": true
*
* @param value JSONata expression that specifies state input to be used
*/
static booleanFromJsonata(value: string): DynamoAttributeValue;
/**
* Sets an attribute of type Boolean from state input through Json path.
* For example: "BOOL": true
*
* @param value Json path that specifies state input to be used
*/
static booleanFromJsonPath(value: string): DynamoAttributeValue;
/**
* Represents the data for the attribute. Data can be
* i.e. "S": "Hello"
*/
readonly attributeValue: any;
private constructor();
/**
* Returns the DynamoDB attribute value
*/
toObject(): any;
}

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamoAttributeValue=exports.DynamoProjectionExpression=exports.DynamoReturnValues=exports.DynamoItemCollectionMetrics=exports.DynamoConsumedCapacity=void 0;const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var utils_1=()=>{var tmp=require("./private/utils");return utils_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},DynamoConsumedCapacity;(function(DynamoConsumedCapacity2){DynamoConsumedCapacity2.INDEXES="INDEXES",DynamoConsumedCapacity2.TOTAL="TOTAL",DynamoConsumedCapacity2.NONE="NONE"})(DynamoConsumedCapacity||(exports.DynamoConsumedCapacity=DynamoConsumedCapacity={}));var DynamoItemCollectionMetrics;(function(DynamoItemCollectionMetrics2){DynamoItemCollectionMetrics2.SIZE="SIZE",DynamoItemCollectionMetrics2.NONE="NONE"})(DynamoItemCollectionMetrics||(exports.DynamoItemCollectionMetrics=DynamoItemCollectionMetrics={}));var DynamoReturnValues;(function(DynamoReturnValues2){DynamoReturnValues2.NONE="NONE",DynamoReturnValues2.ALL_OLD="ALL_OLD",DynamoReturnValues2.UPDATED_OLD="UPDATED_OLD",DynamoReturnValues2.ALL_NEW="ALL_NEW",DynamoReturnValues2.UPDATED_NEW="UPDATED_NEW"})(DynamoReturnValues||(exports.DynamoReturnValues=DynamoReturnValues={}));class DynamoProjectionExpression{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.DynamoProjectionExpression",version:"2.252.0"};expression=[];withAttribute(attr){return this.expression.length?this.expression.push(`.${attr}`):this.expression.push(attr),this}atIndex(index){if(!this.expression.length)throw new(core_1()).UnscopedValidationError((0,literal_string_1().lit)`ExpressionStartAttribute`,"Expression must start with an attribute");return this.expression.push(`[${index}]`),this}toString(){return this.expression.join("")}}exports.DynamoProjectionExpression=DynamoProjectionExpression;class DynamoAttributeValue{static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.DynamoAttributeValue",version:"2.252.0"};static fromString(value){return new DynamoAttributeValue({S:value})}static fromNumber(value){return new DynamoAttributeValue({N:value.toString()})}static numberFromString(value){return new DynamoAttributeValue({N:value.toString()})}static fromBinary(value){return new DynamoAttributeValue({B:value})}static fromStringSet(value){return new DynamoAttributeValue({SS:value})}static fromNumberSet(value){return new DynamoAttributeValue({NS:value.map(String)})}static numberSetFromStrings(value){return new DynamoAttributeValue({NS:value})}static fromBinarySet(value){return new DynamoAttributeValue({BS:value})}static fromMap(value){return new DynamoAttributeValue({M:(0,utils_1().transformAttributeValueMap)(value)})}static mapFromJsonata(value){return(0,utils_1().validateJsonata)(value),new DynamoAttributeValue({M:value})}static mapFromJsonPath(value){return(0,utils_1().validateJsonPath)(value),new DynamoAttributeValue({"M.$":value})}static fromList(value){return new DynamoAttributeValue({L:value.map(val=>val.toObject())})}static listFromJsonata(value){return(0,utils_1().validateJsonata)(value),new DynamoAttributeValue({L:value})}static listFromJsonPath(value){return(0,utils_1().validateJsonPath)(value),new DynamoAttributeValue({L:value})}static fromNull(value){return new DynamoAttributeValue({NULL:value})}static fromBoolean(value){return new DynamoAttributeValue({BOOL:value})}static booleanFromJsonata(value){return(0,utils_1().validateJsonata)(value),new DynamoAttributeValue({BOOL:value})}static booleanFromJsonPath(value){return(0,utils_1().validateJsonPath)(value),new DynamoAttributeValue({BOOL:value.toString()})}attributeValue;constructor(value){this.attributeValue=value}toObject(){return this.attributeValue}}exports.DynamoAttributeValue=DynamoAttributeValue;

View File

@@ -0,0 +1,122 @@
import type { Construct } from 'constructs';
import type { DynamoAttributeValue, DynamoConsumedCapacity, DynamoItemCollectionMetrics, DynamoReturnValues } from './shared-types';
import type * as ddb from '../../../aws-dynamodb';
import * as iam from '../../../aws-iam';
import * as sfn from '../../../aws-stepfunctions';
interface DynamoUpdateItemOptions {
/**
* The name of the table containing the requested item.
*/
readonly table: ddb.ITableRef;
/**
* Primary key of the item to retrieve.
*
* For the primary key, you must provide all of the attributes.
* For example, with a simple primary key, you only need to provide a value for the partition key.
* For a composite primary key, you must provide values for both the partition key and the sort key.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html#DDB-GetItem-request-Key
*/
readonly key: {
[key: string]: DynamoAttributeValue;
};
/**
* A condition that must be satisfied in order for a conditional DeleteItem to succeed.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-UpdateItem-request-ConditionExpression
*
* @default - No condition expression
*/
readonly conditionExpression?: string;
/**
* One or more substitution tokens for attribute names in an expression
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-UpdateItem-request-ExpressionAttributeNames
*
* @default - No expression attribute names
*/
readonly expressionAttributeNames?: {
[key: string]: string;
};
/**
* One or more values that can be substituted in an expression.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-UpdateItem-request-ExpressionAttributeValues
*
* @default - No expression attribute values
*/
readonly expressionAttributeValues?: {
[key: string]: DynamoAttributeValue;
};
/**
* Determines the level of detail about provisioned throughput consumption that is returned in the response
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-UpdateItem-request-ReturnConsumedCapacity
*
* @default DynamoConsumedCapacity.NONE
*/
readonly returnConsumedCapacity?: DynamoConsumedCapacity;
/**
* Determines whether item collection metrics are returned.
* If set to SIZE, the response includes statistics about item collections, if any,
* that were modified during the operation are returned in the response.
* If set to NONE (the default), no statistics are returned.
*
* @default DynamoItemCollectionMetrics.NONE
*/
readonly returnItemCollectionMetrics?: DynamoItemCollectionMetrics;
/**
* Use ReturnValues if you want to get the item attributes as they appeared before they were deleted.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-UpdateItem-request-ReturnValues
*
* @default DynamoReturnValues.NONE
*/
readonly returnValues?: DynamoReturnValues;
/**
* An expression that defines one or more attributes to be updated,
* the action to be performed on them, and new values for them.
*
* @see https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#DDB-UpdateItem-request-UpdateExpression
*
* @default - No update expression
*/
readonly updateExpression?: string;
}
/**
* Properties for DynamoUpdateItem Task using JSONPath
*/
export interface DynamoUpdateItemJsonPathProps extends sfn.TaskStateJsonPathBaseProps, DynamoUpdateItemOptions {
}
/**
* Properties for DynamoUpdateItem Task using JSONata
*/
export interface DynamoUpdateItemJsonataProps extends sfn.TaskStateJsonataBaseProps, DynamoUpdateItemOptions {
}
/**
* Properties for DynamoUpdateItem Task
*/
export interface DynamoUpdateItemProps extends sfn.TaskStateBaseProps, DynamoUpdateItemOptions {
}
/**
* A StepFunctions task to call DynamoUpdateItem
*/
export declare class DynamoUpdateItem extends sfn.TaskStateBase {
private readonly props;
/**
* A StepFunctions task using JSONPath to call DynamoUpdateItem
*/
static jsonPath(scope: Construct, id: string, props: DynamoUpdateItemJsonPathProps): DynamoUpdateItem;
/**
* A StepFunctions task using JSONata to call DynamoUpdateItem
*/
static jsonata(scope: Construct, id: string, props: DynamoUpdateItemJsonataProps): DynamoUpdateItem;
protected readonly taskMetrics?: sfn.TaskMetricsConfig;
protected readonly taskPolicies?: iam.PolicyStatement[];
constructor(scope: Construct, id: string, props: DynamoUpdateItemProps);
/**
* @internal
*/
protected _renderTask(topLevelQueryLanguage?: sfn.QueryLanguage): any;
}
export {};

View File

@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.DynamoUpdateItem=void 0;var jsiiDeprecationWarnings=()=>{var tmp=require("../../../.warnings.jsii.js");return jsiiDeprecationWarnings=()=>tmp,tmp};const JSII_RTTI_SYMBOL_1=Symbol.for("jsii.rtti");var utils_1=()=>{var tmp=require("./private/utils");return utils_1=()=>tmp,tmp},iam=()=>{var tmp=require("../../../aws-iam");return iam=()=>tmp,tmp},sfn=()=>{var tmp=require("../../../aws-stepfunctions");return sfn=()=>tmp,tmp},core_1=()=>{var tmp=require("../../../core");return core_1=()=>tmp,tmp};class DynamoUpdateItem extends sfn().TaskStateBase{props;static[JSII_RTTI_SYMBOL_1]={fqn:"aws-cdk-lib.aws_stepfunctions_tasks.DynamoUpdateItem",version:"2.252.0"};static jsonPath(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoUpdateItemJsonPathProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonPath),error}return new DynamoUpdateItem(scope,id,props)}static jsonata(scope,id,props){try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoUpdateItemJsonataProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,this.jsonata),error}return new DynamoUpdateItem(scope,id,{...props,queryLanguage:sfn().QueryLanguage.JSONATA})}taskMetrics;taskPolicies;constructor(scope,id,props){super(scope,id,props),this.props=props;try{jsiiDeprecationWarnings().aws_cdk_lib_aws_stepfunctions_tasks_DynamoUpdateItemProps(props)}catch(error){throw process.env.JSII_DEBUG!=="1"&&error.name==="DeprecationError"&&Error.captureStackTrace(error,DynamoUpdateItem),error}this.taskPolicies=[new(iam()).PolicyStatement({resources:[core_1().Stack.of(this).formatArn({service:"dynamodb",resource:"table",resourceName:props.table.tableRef.tableName})],actions:[`dynamodb:${utils_1().DynamoMethod.UPDATE}Item`]})]}_renderTask(topLevelQueryLanguage){const queryLanguage=sfn()._getActualQueryLanguage(topLevelQueryLanguage,this.props.queryLanguage);return{Resource:(0,utils_1().getDynamoResourceArn)(utils_1().DynamoMethod.UPDATE),...this._renderParametersOrArguments({Key:(0,utils_1().transformAttributeValueMap)(this.props.key),TableName:this.props.table.tableRef.tableName,ConditionExpression:this.props.conditionExpression,ExpressionAttributeNames:this.props.expressionAttributeNames,ExpressionAttributeValues:(0,utils_1().transformAttributeValueMap)(this.props.expressionAttributeValues),ReturnConsumedCapacity:this.props.returnConsumedCapacity,ReturnItemCollectionMetrics:this.props.returnItemCollectionMetrics,ReturnValues:this.props.returnValues,UpdateExpression:this.props.updateExpression},queryLanguage)}}}exports.DynamoUpdateItem=DynamoUpdateItem;