@cxbuilder/flow-config 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +131 -65
- package/CHANGELOG.md +20 -0
- package/README.md +8 -5
- package/dist/backend/FlowConfig/index.js +2 -1
- package/dist/backend/FlowConfig/index.js.map +2 -2
- package/dist/backend/GetConfig/index.js +1 -1
- package/dist/backend/GetConfig/index.js.map +2 -2
- package/dist/backend/Init/index.js +2 -1
- package/dist/backend/Init/index.js.map +2 -2
- package/dist/backend/Settings/index.js +255 -0
- package/dist/backend/Settings/index.js.map +7 -0
- package/dist/backend/Static/static/assets/index-Cejunttu.js +61 -0
- package/dist/backend/Static/static/assets/{index-NRh8x3FI.css → index-SZuscj14.css} +1 -1
- package/dist/backend/Static/static/index.html +3 -3
- package/dist/infrastructure/FlowConfigStack.d.ts +32 -14
- package/dist/infrastructure/FlowConfigStack.js +27 -18
- package/dist/infrastructure/GetConfig/index.js +2 -2
- package/dist/infrastructure/api/Api.d.ts +5 -2
- package/dist/infrastructure/api/Api.js +21 -15
- package/dist/infrastructure/api/Init/Init.interface.d.ts +4 -0
- package/dist/infrastructure/api/Init/Init.interface.js +1 -1
- package/dist/infrastructure/api/Init/index.js +2 -1
- package/dist/infrastructure/api/Settings/Settings.interface.d.ts +3 -0
- package/dist/infrastructure/api/Settings/Settings.interface.js +3 -0
- package/dist/infrastructure/api/Settings/index.d.ts +7 -0
- package/dist/infrastructure/api/Settings/index.js +21 -0
- package/dist/infrastructure/api/spec.yaml +122 -0
- package/dist/infrastructure/createLambda.js +1 -1
- package/dist/infrastructure/index.d.ts +1 -1
- package/dist/infrastructure/index.js +1 -1
- package/dist/infrastructure/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/backend/Static/static/assets/index-FHwnAA8f.js +0 -61
package/.jsii
CHANGED
|
@@ -3984,7 +3984,7 @@
|
|
|
3984
3984
|
},
|
|
3985
3985
|
"name": "@cxbuilder/flow-config",
|
|
3986
3986
|
"readme": {
|
|
3987
|
-
"markdown": "# @cxbuilder/flow-config\n\nAWS CDK constructs for Amazon Connect FlowConfig - a third-party app for configuring variables and prompts in Connect contact flows.\n\n## Links\n\n- [Screenshots](./docs/screenshots/)\n- [Architecture](./docs/Architecture.md)\n- [DataModel](./docs/DataModel.md)\n\n## Installation\n\n```bash\nnpm install @cxbuilder/flow-config\n```\n\n## Usage\n\n### Standard Deployment (Public)\n\n```typescript\nimport { FlowConfigStack } from '@cxbuilder/flow-config';\nimport * as cdk from 'aws-cdk-lib';\n\nconst app = new cdk.App();\nnew FlowConfigStack(app, 'FlowConfigStack', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-east-1',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-east-1_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-east-1:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n});\n```\n\n### VPC Private Deployment\n\nFor enhanced security, you can deploy the application to run entirely within a VPC with private endpoints:\n\n```typescript\nimport { FlowConfigStack, VpcConfig } from '@cxbuilder/flow-config';\nimport * as cdk from 'aws-cdk-lib';\n\nconst app = new cdk.App();\n\n// Configure VPC using string IDs - the stack will resolve these to CDK objects\nconst vpcConfig: VpcConfig = {\n vpcId: 'vpc-12345678',\n lambdaSecurityGroupIds: ['sg-lambda123'],\n privateSubnetIds: ['subnet-12345', 'subnet-67890'],\n vpcEndpointSecurityGroupIds: ['sg-endpoint123'],\n};\n\nnew FlowConfigStack(app, 'FlowConfigStack', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-east-1',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-east-1_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-east-1:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n vpc: vpcConfig, // Enable VPC private deployment\n});\n```\n\n### Multi-Region Global Table Deployment\n\nFor global resilience, deploy the application across multiple regions with DynamoDB Global Tables:\n\n#### Primary Region Setup\n\n```typescript\nimport { FlowConfigStack, GlobalTableConfig } from '@cxbuilder/flow-config';\nimport * as cdk from 'aws-cdk-lib';\n\nconst app = new cdk.App();\n\n// Primary region creates the global table with replicas\nconst primaryGlobalTable: GlobalTableConfig = {\n isPrimaryRegion: true,\n replicaRegions: ['us-west-2', 'eu-west-1'],\n};\n\nnew FlowConfigStack(app, 'FlowConfigStack-Primary', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-east-1',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-east-1_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-east-1:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n globalTable: primaryGlobalTable, // Enable global table\n});\n```\n\n#### Secondary Region Setup\n\n```typescript\nnew FlowConfigStack(app, 'FlowConfigStack-Secondary', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-west-2',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-west-2_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-west-2:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n globalTable: {\n isPrimaryRegion: false, // Reference global table\n },\n});\n```\n\n## Features\n\n- **Serverless Architecture**: Built with AWS Lambda, DynamoDB, and API Gateway\n- **Amazon Connect Integration**: GetConfig Lambda function integrated directly with Connect contact flows\n- **Third-Party App**: Web-based interface embedded in Amazon Connect Agent Workspace\n- **Multi-Language Support**: Configure prompts for different languages and channels (voice/chat)\n- **Real-time Preview**: Text-to-speech preview using Amazon Polly\n- **Secure Access**: Integration with Amazon Connect and AWS Verified Permissions\n- **Flexible Deployment Options**:\n - **Single-Region**: Standard deployment with regional DynamoDB table\n - **Multi-Region**: Global table support with automatic replication across regions\n - **Public Deployment**: Standard internet-accessible API Gateway and Lambda functions\n - **VPC Private Deployment**: Private API Gateway endpoints, VPC-enabled Lambda functions, and VPC endpoints for enhanced security\n\n## GetConfig Lambda Integration\n\nThe GetConfig Lambda function is used within contact flows to access your flow configs. This function is automatically integrated with your Amazon Connect instance during deployment.\n\n### Contact Flow Event Structure\n\nThe Lambda function handles Amazon Connect Contact Flow events with the following structure:\n\n```json\n{\n \"Details\": {\n \"Parameters\": {\n \"id\": \"main-queue\",\n \"lang\": \"es-US\"\n },\n \"ContactData\": {\n \"Channel\": \"VOICE\",\n \"Attributes\": {\n \"lang\": \"en-US\"\n }\n }\n }\n}\n```\n\n### Input Parameters and Priority\n\n1. **Required Parameters**:\n\n - **`id`**: Flow configuration identifier (always required)\n - Provided via `Details.Parameters.id`\n\n2. **Optional Language Selection** (in order of precedence):\n\n - `Details.Parameters.lang` (highest priority)\n - `Details.ContactData.Attributes.lang`\n - Defaults to `\"en-US\"`\n\n3. **Channel Detection**:\n - Automatically read from `Details.ContactData.Channel`\n - Supports `\"VOICE\"` and `\"CHAT\"`\n - Defaults to `\"voice\"`\n\n### Alternative Input Format (Testing)\n\nFor direct testing or non-Connect invocation:\n\n```json\n{\n \"id\": \"main-queue\",\n \"lang\": \"es-US\",\n \"channel\": \"voice\"\n}\n```\n\n### Function Behavior\n\n1. **Parameter Resolution**:\n\n - Extracts `id` from Connect event parameters (required)\n - Resolves language from parameters → attributes → default\n - Determines channel from Contact Flow event data\n\n2. **Processing Steps**:\n\n - Retrieves the flow config from DynamoDB using the provided ID\n - Includes all variables from the flow config in the result\n - For each prompt in the flow config:\n - Selects the appropriate language version\n - Uses voice content by default\n - For chat channel:\n - Uses chat-specific content if available\n - Strips SSML tags from voice content if no chat content exists\n\n3. **Output**:\n - Returns a flattened object containing:\n - All variable key-value pairs from the flow config\n - All prompt values resolved for the specified language and channel\n\n### Setting Up in Contact Flow\n\n1. **Add \"Invoke AWS Lambda function\" block** to your contact flow\n2. **Select the GetConfig Lambda function** (deployed as `${prefix}-get-config`)\n3. **Configure parameters**:\n\n```json\n{\n \"id\": \"main-queue\"\n}\n```\n\nOr with explicit language:\n\n```json\n{\n \"id\": \"main-queue\",\n \"lang\": \"es-US\"\n}\n```\n\n### Using Returned Data\n\nThe Lambda response is automatically available in subsequent blocks:\n\n- **Set contact attributes**: Use `$.External.variableName`\n- **Play prompt**: Use `$.External.promptName`\n- **Check contact attributes**: Reference returned variables for routing decisions\n\n### Example Contact Flow Integration\n\n```\n[Get customer input] → [Invoke Lambda: GetConfig]\n ↓\n [Set contact attributes]\n ↓\n [Play prompt: $.External.welcomeMessage]\n ↓\n [Route based on: $.External.routingMode]\n```\n\n### Size Considerations\n\n- Amazon Connect has a Lambda response size limit of 32KB\n- The combined size of returned variables and prompts should be less than this limit\n- For large flow configs with many prompts or languages, consider implementing pagination or selective loading\n\n### Logger\n\n[Lambda PowerTools Logger](https://docs.powertools.aws.dev/lambda/typescript/latest/core/logger/) provides a lightweight logger implementation with JSON output.\n\nTips:\n\n- Use the `appendKeys()` method to add `ContactId` to your connect log lambda output.\n\n### Open API Spec\n\nThis template defines an Open API Spec for the API GW Lambdas. This allows use to generate a TypeScript api client to be used by the frontend app. We can also generate a API client in any language from the same spec to allow the client to better integrate with our apps.\n\n- [constructs/aws-openapigateway-lambda](https://docs.aws.amazon.com/solutions/latest/constructs/aws-openapigateway-lambda.html)\n- [OpenAPI Editor](https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi)\n- [OpenApy TypeScript Generator](https://openapi-ts.pages.dev/introduction)\n\n## Development\n\n### Frontend Development\n\nThe frontend React application integrates with Amazon Connect Agent Workspace using the Connect SDK:\n\n```bash\n# Start local development server\nnpm start\n\n# Build for production\nnpm run build\n```\n\nFor local development, point your Amazon Connect third-party app configuration to `localhost:3000`. The application requires execution within Agent Workspace for Connect SDK functionality.\n\n### Lambda Development\n\nLambda functions are bundled automatically during the build process:\n\n```bash\n# Bundle Lambda functions\nnpm run build:lambdas\n\n# Full build (CDK + Frontend + Lambdas)\nnpm run build\n```\n"
|
|
3987
|
+
"markdown": "# @cxbuilder/flow-config\n\n[](https://github.com/cxbuilder/flow-config/actions/workflows/ci-cd.yml)\n[](https://badge.fury.io/js/@cxbuilder%2Fflow-config)\n[](https://badge.fury.io/py/cxbuilder-flow-config)\n[](https://constructs.dev/packages/@cxbuilder/flow-config)\n\nAWS CDK constructs for Amazon Connect FlowConfig - a third-party app for configuring variables and prompts in Connect contact flows.\n\n## Links\n\n- [Screenshots](./docs/screenshots/)\n- [Architecture](./docs/Architecture.md)\n- [DataModel](./docs/DataModel.md)\n\n## Installation\n\n```bash\nnpm install @cxbuilder/flow-config\n```\n\n## Usage\n\n### Standard Deployment (Public)\n\n```typescript\nimport { FlowConfigStack } from '@cxbuilder/flow-config';\nimport * as cdk from 'aws-cdk-lib';\n\nconst app = new cdk.App();\nnew FlowConfigStack(app, 'FlowConfigStack', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-east-1',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-east-1_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-east-1:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n});\n```\n\n### VPC Private Deployment\n\nFor enhanced security, you can deploy the application to run entirely within a VPC with private endpoints:\n\n```typescript\nimport { FlowConfigStack, VpcConfig } from '@cxbuilder/flow-config';\nimport * as cdk from 'aws-cdk-lib';\n\nconst app = new cdk.App();\n\n// Configure VPC using string IDs - the stack will resolve these to CDK objects\nconst vpcConfig: VpcConfig = {\n vpcId: 'vpc-12345678',\n lambdaSecurityGroupIds: ['sg-lambda123'],\n privateSubnetIds: ['subnet-12345', 'subnet-67890'],\n vpcEndpointSecurityGroupIds: ['sg-endpoint123'],\n};\n\nnew FlowConfigStack(app, 'FlowConfigStack', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-east-1',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-east-1_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-east-1:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n vpc: vpcConfig, // Enable VPC private deployment\n});\n```\n\n### Multi-Region Global Table Deployment\n\nFor global resilience, deploy the application across multiple regions with DynamoDB Global Tables:\n\n#### Primary Region Setup\n\n```typescript\nimport { FlowConfigStack, GlobalTableConfig } from '@cxbuilder/flow-config';\nimport * as cdk from 'aws-cdk-lib';\n\nconst app = new cdk.App();\n\n// Primary region creates the global table with replicas\nconst primaryGlobalTable: GlobalTableConfig = {\n isPrimaryRegion: true,\n replicaRegions: ['us-west-2', 'eu-west-1'],\n};\n\nnew FlowConfigStack(app, 'FlowConfigStack-Primary', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-east-1',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-east-1_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-east-1:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n globalTable: primaryGlobalTable, // Enable global table\n});\n```\n\n#### Secondary Region Setup\n\n```typescript\nnew FlowConfigStack(app, 'FlowConfigStack-Secondary', {\n prefix: 'my-flow-config',\n env: {\n region: 'us-west-2',\n account: 'YOUR_ACCOUNT_ID',\n },\n cognito: {\n domain: 'https://your-auth-domain.com',\n userPoolId: 'us-west-2_YourPoolId',\n },\n connectInstanceArn:\n 'arn:aws:connect:us-west-2:YOUR_ACCOUNT:instance/YOUR_INSTANCE_ID',\n alertEmails: ['admin@yourcompany.com'],\n globalTable: {\n isPrimaryRegion: false, // Reference global table\n },\n});\n```\n\n## Features\n\n- **Serverless Architecture**: Built with AWS Lambda, DynamoDB, and API Gateway\n- **Amazon Connect Integration**: GetConfig Lambda function integrated directly with Connect contact flows\n- **Third-Party App**: Web-based interface embedded in Amazon Connect Agent Workspace\n- **Multi-Language Support**: Configure prompts for different languages and channels (voice/chat)\n- **Real-time Preview**: Text-to-speech preview using Amazon Polly\n- **Secure Access**: Integration with Amazon Connect and AWS Verified Permissions\n- **Flexible Deployment Options**:\n - **Single-Region**: Standard deployment with regional DynamoDB table\n - **Multi-Region**: Global table support with automatic replication across regions\n - **Public Deployment**: Standard internet-accessible API Gateway and Lambda functions\n - **VPC Private Deployment**: Private API Gateway endpoints, VPC-enabled Lambda functions, and VPC endpoints for enhanced security\n\n## GetConfig Lambda Integration\n\nThe GetConfig Lambda function is used within contact flows to access your flow configs. This function is automatically integrated with your Amazon Connect instance during deployment.\n\n### Contact Flow Event Structure\n\nThe Lambda function handles Amazon Connect Contact Flow events with the following structure:\n\n```json\n{\n \"Details\": {\n \"Parameters\": {\n \"id\": \"main-queue\",\n \"lang\": \"es-US\"\n },\n \"ContactData\": {\n \"Channel\": \"VOICE\",\n \"LanguageCode\": \"en-US\"\n }\n }\n}\n```\n\n### Input Parameters and Priority\n\n1. **Required Parameters**:\n\n - **`id`**: Flow configuration identifier (always required)\n - Provided via `Details.Parameters.id`\n\n2. **Optional Language Selection** (in order of precedence):\n\n - `Details.Parameters.lang` (highest priority)\n - `Details.ContactData.LanguageCode`\n - Defaults to `\"en-US\"`\n\n3. **Channel Detection**:\n - Automatically read from `Details.ContactData.Channel`\n - Supports `\"VOICE\"` and `\"CHAT\"`\n - Defaults to `\"voice\"`\n\n### Alternative Input Format (Testing)\n\nFor direct testing or non-Connect invocation:\n\n```json\n{\n \"id\": \"main-queue\",\n \"lang\": \"es-US\",\n \"channel\": \"voice\"\n}\n```\n\n### Function Behavior\n\n1. **Parameter Resolution**:\n\n - Extracts `id` from Connect event parameters (required)\n - Resolves language from parameters → attributes → default\n - Determines channel from Contact Flow event data\n\n2. **Processing Steps**:\n\n - Retrieves the flow config from DynamoDB using the provided ID\n - Includes all variables from the flow config in the result\n - For each prompt in the flow config:\n - Selects the appropriate language version\n - Uses voice content by default\n - For chat channel:\n - Uses chat-specific content if available\n - Strips SSML tags from voice content if no chat content exists\n\n3. **Output**:\n - Returns a flattened object containing:\n - All variable key-value pairs from the flow config\n - All prompt values resolved for the specified language and channel\n\n### Setting Up in Contact Flow\n\n1. **Add \"Invoke AWS Lambda function\" block** to your contact flow\n2. **Select the GetConfig Lambda function** (deployed as `${prefix}`)\n3. **Configure parameters**:\n\n```json\n{\n \"id\": \"main-queue\"\n}\n```\n\nOr with explicit language:\n\n```json\n{\n \"id\": \"main-queue\",\n \"lang\": \"es-US\"\n}\n```\n\n### Using Returned Data\n\nThe Lambda response is automatically available in subsequent blocks:\n\n- **Set contact attributes**: Use `$.External.variableName`\n- **Play prompt**: Use `$.External.promptName`\n- **Check contact attributes**: Reference returned variables for routing decisions\n\n### Example Contact Flow Integration\n\n```\n[Get customer input] → [Invoke Lambda: GetConfig]\n ↓\n [Set contact attributes]\n ↓\n [Play prompt: $.External.welcomeMessage]\n ↓\n [Route based on: $.External.routingMode]\n```\n\n### Size Considerations\n\n- Amazon Connect has a Lambda response size limit of 32KB\n- The combined size of returned variables and prompts should be less than this limit\n- For large flow configs with many prompts or languages, consider implementing pagination or selective loading\n\n### Logger\n\n[Lambda PowerTools Logger](https://docs.powertools.aws.dev/lambda/typescript/latest/core/logger/) provides a lightweight logger implementation with JSON output.\n\nTips:\n\n- Use the `appendKeys()` method to add `ContactId` to your connect log lambda output.\n\n### Open API Spec\n\nThis template defines an Open API Spec for the API GW Lambdas. This allows use to generate a TypeScript api client to be used by the frontend app. We can also generate a API client in any language from the same spec to allow the client to better integrate with our apps.\n\n- [constructs/aws-openapigateway-lambda](https://docs.aws.amazon.com/solutions/latest/constructs/aws-openapigateway-lambda.html)\n- [OpenAPI Editor](https://marketplace.visualstudio.com/items?itemName=42Crunch.vscode-openapi)\n- [OpenApy TypeScript Generator](https://openapi-ts.pages.dev/introduction)\n\n## Development\n\n### Frontend Development\n\nThe frontend React application integrates with Amazon Connect Agent Workspace using the Connect SDK:\n\n```bash\n# Start local development server\nnpm start\n\n# Build for production\nnpm run build\n```\n\nFor local development, point your Amazon Connect third-party app configuration to `localhost:3000`. The application requires execution within Agent Workspace for Connect SDK functionality.\n\n### Lambda Development\n\nLambda functions are bundled automatically during the build process:\n\n```bash\n# Bundle Lambda functions\nnpm run build:lambdas\n\n# Full build (CDK + Frontend + Lambdas)\nnpm run build\n```\n"
|
|
3988
3988
|
},
|
|
3989
3989
|
"repository": {
|
|
3990
3990
|
"type": "git",
|
|
@@ -4005,6 +4005,56 @@
|
|
|
4005
4005
|
}
|
|
4006
4006
|
},
|
|
4007
4007
|
"types": {
|
|
4008
|
+
"@cxbuilder/flow-config.ApiVpcConfig": {
|
|
4009
|
+
"assembly": "@cxbuilder/flow-config",
|
|
4010
|
+
"datatype": true,
|
|
4011
|
+
"docs": {
|
|
4012
|
+
"stability": "stable",
|
|
4013
|
+
"summary": "VPC configuration for API Gateway If provided, the API will be deployed in a private VPC."
|
|
4014
|
+
},
|
|
4015
|
+
"fqn": "@cxbuilder/flow-config.ApiVpcConfig",
|
|
4016
|
+
"kind": "interface",
|
|
4017
|
+
"locationInModule": {
|
|
4018
|
+
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4019
|
+
"line": 42
|
|
4020
|
+
},
|
|
4021
|
+
"name": "ApiVpcConfig",
|
|
4022
|
+
"properties": [
|
|
4023
|
+
{
|
|
4024
|
+
"abstract": true,
|
|
4025
|
+
"docs": {
|
|
4026
|
+
"stability": "stable",
|
|
4027
|
+
"summary": "The VPC endpoint ID to use for the API."
|
|
4028
|
+
},
|
|
4029
|
+
"immutable": true,
|
|
4030
|
+
"locationInModule": {
|
|
4031
|
+
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4032
|
+
"line": 50
|
|
4033
|
+
},
|
|
4034
|
+
"name": "vpcEndpointId",
|
|
4035
|
+
"type": {
|
|
4036
|
+
"primitive": "string"
|
|
4037
|
+
}
|
|
4038
|
+
},
|
|
4039
|
+
{
|
|
4040
|
+
"abstract": true,
|
|
4041
|
+
"docs": {
|
|
4042
|
+
"stability": "stable",
|
|
4043
|
+
"summary": "The VPC ID to use for the API."
|
|
4044
|
+
},
|
|
4045
|
+
"immutable": true,
|
|
4046
|
+
"locationInModule": {
|
|
4047
|
+
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4048
|
+
"line": 46
|
|
4049
|
+
},
|
|
4050
|
+
"name": "vpcId",
|
|
4051
|
+
"type": {
|
|
4052
|
+
"primitive": "string"
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
],
|
|
4056
|
+
"symbolId": "infrastructure/FlowConfigStack:ApiVpcConfig"
|
|
4057
|
+
},
|
|
4008
4058
|
"@cxbuilder/flow-config.CognitoConfig": {
|
|
4009
4059
|
"assembly": "@cxbuilder/flow-config",
|
|
4010
4060
|
"datatype": true,
|
|
@@ -4085,7 +4135,7 @@
|
|
|
4085
4135
|
},
|
|
4086
4136
|
"locationInModule": {
|
|
4087
4137
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4088
|
-
"line":
|
|
4138
|
+
"line": 162
|
|
4089
4139
|
},
|
|
4090
4140
|
"parameters": [
|
|
4091
4141
|
{
|
|
@@ -4111,7 +4161,7 @@
|
|
|
4111
4161
|
"kind": "class",
|
|
4112
4162
|
"locationInModule": {
|
|
4113
4163
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4114
|
-
"line":
|
|
4164
|
+
"line": 138
|
|
4115
4165
|
},
|
|
4116
4166
|
"methods": [
|
|
4117
4167
|
{
|
|
@@ -4121,7 +4171,7 @@
|
|
|
4121
4171
|
},
|
|
4122
4172
|
"locationInModule": {
|
|
4123
4173
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4124
|
-
"line":
|
|
4174
|
+
"line": 288
|
|
4125
4175
|
},
|
|
4126
4176
|
"name": "associate3pApp"
|
|
4127
4177
|
},
|
|
@@ -4131,7 +4181,7 @@
|
|
|
4131
4181
|
},
|
|
4132
4182
|
"locationInModule": {
|
|
4133
4183
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4134
|
-
"line":
|
|
4184
|
+
"line": 228
|
|
4135
4185
|
},
|
|
4136
4186
|
"name": "createUserPoolClient",
|
|
4137
4187
|
"returns": {
|
|
@@ -4147,7 +4197,7 @@
|
|
|
4147
4197
|
},
|
|
4148
4198
|
"locationInModule": {
|
|
4149
4199
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4150
|
-
"line":
|
|
4200
|
+
"line": 256
|
|
4151
4201
|
},
|
|
4152
4202
|
"name": "createUserPoolGroups"
|
|
4153
4203
|
}
|
|
@@ -4161,7 +4211,7 @@
|
|
|
4161
4211
|
"immutable": true,
|
|
4162
4212
|
"locationInModule": {
|
|
4163
4213
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4164
|
-
"line":
|
|
4214
|
+
"line": 158
|
|
4165
4215
|
},
|
|
4166
4216
|
"name": "appUrl",
|
|
4167
4217
|
"type": {
|
|
@@ -4174,7 +4224,7 @@
|
|
|
4174
4224
|
},
|
|
4175
4225
|
"locationInModule": {
|
|
4176
4226
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4177
|
-
"line":
|
|
4227
|
+
"line": 142
|
|
4178
4228
|
},
|
|
4179
4229
|
"name": "alertTopic",
|
|
4180
4230
|
"type": {
|
|
@@ -4187,7 +4237,7 @@
|
|
|
4187
4237
|
},
|
|
4188
4238
|
"locationInModule": {
|
|
4189
4239
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4190
|
-
"line":
|
|
4240
|
+
"line": 165
|
|
4191
4241
|
},
|
|
4192
4242
|
"name": "props",
|
|
4193
4243
|
"type": {
|
|
@@ -4200,7 +4250,7 @@
|
|
|
4200
4250
|
},
|
|
4201
4251
|
"locationInModule": {
|
|
4202
4252
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4203
|
-
"line":
|
|
4253
|
+
"line": 143
|
|
4204
4254
|
},
|
|
4205
4255
|
"name": "table",
|
|
4206
4256
|
"type": {
|
|
@@ -4213,7 +4263,7 @@
|
|
|
4213
4263
|
},
|
|
4214
4264
|
"locationInModule": {
|
|
4215
4265
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4216
|
-
"line":
|
|
4266
|
+
"line": 139
|
|
4217
4267
|
},
|
|
4218
4268
|
"name": "userPool",
|
|
4219
4269
|
"type": {
|
|
@@ -4226,7 +4276,7 @@
|
|
|
4226
4276
|
},
|
|
4227
4277
|
"locationInModule": {
|
|
4228
4278
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4229
|
-
"line":
|
|
4279
|
+
"line": 141
|
|
4230
4280
|
},
|
|
4231
4281
|
"name": "userPoolClient",
|
|
4232
4282
|
"type": {
|
|
@@ -4249,7 +4299,7 @@
|
|
|
4249
4299
|
"kind": "interface",
|
|
4250
4300
|
"locationInModule": {
|
|
4251
4301
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4252
|
-
"line":
|
|
4302
|
+
"line": 98
|
|
4253
4303
|
},
|
|
4254
4304
|
"name": "FlowConfigStackProps",
|
|
4255
4305
|
"properties": [
|
|
@@ -4262,7 +4312,7 @@
|
|
|
4262
4312
|
"immutable": true,
|
|
4263
4313
|
"locationInModule": {
|
|
4264
4314
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4265
|
-
"line":
|
|
4315
|
+
"line": 110
|
|
4266
4316
|
},
|
|
4267
4317
|
"name": "alertEmails",
|
|
4268
4318
|
"type": {
|
|
@@ -4282,7 +4332,7 @@
|
|
|
4282
4332
|
"immutable": true,
|
|
4283
4333
|
"locationInModule": {
|
|
4284
4334
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4285
|
-
"line":
|
|
4335
|
+
"line": 104
|
|
4286
4336
|
},
|
|
4287
4337
|
"name": "cognito",
|
|
4288
4338
|
"type": {
|
|
@@ -4297,7 +4347,7 @@
|
|
|
4297
4347
|
"immutable": true,
|
|
4298
4348
|
"locationInModule": {
|
|
4299
4349
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4300
|
-
"line":
|
|
4350
|
+
"line": 105
|
|
4301
4351
|
},
|
|
4302
4352
|
"name": "connectInstanceArn",
|
|
4303
4353
|
"type": {
|
|
@@ -4307,19 +4357,56 @@
|
|
|
4307
4357
|
{
|
|
4308
4358
|
"abstract": true,
|
|
4309
4359
|
"docs": {
|
|
4360
|
+
"example": "`cxbuilder-flow-config`",
|
|
4361
|
+
"remarks": "Will also be the name of the Connect Lambda",
|
|
4310
4362
|
"stability": "stable",
|
|
4311
4363
|
"summary": "Used for resource naming."
|
|
4312
4364
|
},
|
|
4313
4365
|
"immutable": true,
|
|
4314
4366
|
"locationInModule": {
|
|
4315
4367
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4316
|
-
"line":
|
|
4368
|
+
"line": 103
|
|
4317
4369
|
},
|
|
4318
4370
|
"name": "prefix",
|
|
4319
4371
|
"type": {
|
|
4320
4372
|
"primitive": "string"
|
|
4321
4373
|
}
|
|
4322
4374
|
},
|
|
4375
|
+
{
|
|
4376
|
+
"abstract": true,
|
|
4377
|
+
"docs": {
|
|
4378
|
+
"stability": "stable",
|
|
4379
|
+
"summary": "If provided, the API will be deployed in a VPC."
|
|
4380
|
+
},
|
|
4381
|
+
"immutable": true,
|
|
4382
|
+
"locationInModule": {
|
|
4383
|
+
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4384
|
+
"line": 116
|
|
4385
|
+
},
|
|
4386
|
+
"name": "apiVpcConfig",
|
|
4387
|
+
"optional": true,
|
|
4388
|
+
"type": {
|
|
4389
|
+
"fqn": "@cxbuilder/flow-config.ApiVpcConfig"
|
|
4390
|
+
}
|
|
4391
|
+
},
|
|
4392
|
+
{
|
|
4393
|
+
"abstract": true,
|
|
4394
|
+
"docs": {
|
|
4395
|
+
"default": "true",
|
|
4396
|
+
"stability": "stable",
|
|
4397
|
+
"summary": "Set to false to remove CXBuilder branding from the web app."
|
|
4398
|
+
},
|
|
4399
|
+
"immutable": true,
|
|
4400
|
+
"locationInModule": {
|
|
4401
|
+
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4402
|
+
"line": 135
|
|
4403
|
+
},
|
|
4404
|
+
"name": "branding",
|
|
4405
|
+
"optional": true,
|
|
4406
|
+
"type": {
|
|
4407
|
+
"primitive": "boolean"
|
|
4408
|
+
}
|
|
4409
|
+
},
|
|
4323
4410
|
{
|
|
4324
4411
|
"abstract": true,
|
|
4325
4412
|
"docs": {
|
|
@@ -4330,7 +4417,7 @@
|
|
|
4330
4417
|
"immutable": true,
|
|
4331
4418
|
"locationInModule": {
|
|
4332
4419
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4333
|
-
"line":
|
|
4420
|
+
"line": 129
|
|
4334
4421
|
},
|
|
4335
4422
|
"name": "globalTable",
|
|
4336
4423
|
"optional": true,
|
|
@@ -4341,35 +4428,35 @@
|
|
|
4341
4428
|
{
|
|
4342
4429
|
"abstract": true,
|
|
4343
4430
|
"docs": {
|
|
4344
|
-
"
|
|
4431
|
+
"remarks": "Note: VPC should contain endpoints to: CloudFormation, Lambda, DynamoDB, SNS, and Polly.",
|
|
4432
|
+
"stability": "stable",
|
|
4433
|
+
"summary": "If provided, the Lambda functions will be deployed in a VPC."
|
|
4345
4434
|
},
|
|
4346
4435
|
"immutable": true,
|
|
4347
4436
|
"locationInModule": {
|
|
4348
4437
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4349
|
-
"line":
|
|
4438
|
+
"line": 122
|
|
4350
4439
|
},
|
|
4351
|
-
"name": "
|
|
4440
|
+
"name": "lambdaVpcConfig",
|
|
4352
4441
|
"optional": true,
|
|
4353
4442
|
"type": {
|
|
4354
|
-
"
|
|
4443
|
+
"fqn": "@cxbuilder/flow-config.LambdaVpcConfig"
|
|
4355
4444
|
}
|
|
4356
4445
|
},
|
|
4357
4446
|
{
|
|
4358
4447
|
"abstract": true,
|
|
4359
4448
|
"docs": {
|
|
4360
|
-
"
|
|
4361
|
-
"stability": "stable",
|
|
4362
|
-
"summary": "VPC configuration for private deployment."
|
|
4449
|
+
"stability": "stable"
|
|
4363
4450
|
},
|
|
4364
4451
|
"immutable": true,
|
|
4365
4452
|
"locationInModule": {
|
|
4366
4453
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4367
|
-
"line":
|
|
4454
|
+
"line": 111
|
|
4368
4455
|
},
|
|
4369
|
-
"name": "
|
|
4456
|
+
"name": "prod",
|
|
4370
4457
|
"optional": true,
|
|
4371
4458
|
"type": {
|
|
4372
|
-
"
|
|
4459
|
+
"primitive": "boolean"
|
|
4373
4460
|
}
|
|
4374
4461
|
}
|
|
4375
4462
|
],
|
|
@@ -4386,7 +4473,7 @@
|
|
|
4386
4473
|
"kind": "interface",
|
|
4387
4474
|
"locationInModule": {
|
|
4388
4475
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4389
|
-
"line":
|
|
4476
|
+
"line": 76
|
|
4390
4477
|
},
|
|
4391
4478
|
"name": "GlobalTableConfig",
|
|
4392
4479
|
"properties": [
|
|
@@ -4399,7 +4486,7 @@
|
|
|
4399
4486
|
"immutable": true,
|
|
4400
4487
|
"locationInModule": {
|
|
4401
4488
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4402
|
-
"line":
|
|
4489
|
+
"line": 80
|
|
4403
4490
|
},
|
|
4404
4491
|
"name": "isPrimaryRegion",
|
|
4405
4492
|
"type": {
|
|
@@ -4415,7 +4502,7 @@
|
|
|
4415
4502
|
"immutable": true,
|
|
4416
4503
|
"locationInModule": {
|
|
4417
4504
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4418
|
-
"line":
|
|
4505
|
+
"line": 86
|
|
4419
4506
|
},
|
|
4420
4507
|
"name": "replicaRegions",
|
|
4421
4508
|
"optional": true,
|
|
@@ -4431,20 +4518,20 @@
|
|
|
4431
4518
|
],
|
|
4432
4519
|
"symbolId": "infrastructure/FlowConfigStack:GlobalTableConfig"
|
|
4433
4520
|
},
|
|
4434
|
-
"@cxbuilder/flow-config.
|
|
4521
|
+
"@cxbuilder/flow-config.LambdaVpcConfig": {
|
|
4435
4522
|
"assembly": "@cxbuilder/flow-config",
|
|
4436
4523
|
"datatype": true,
|
|
4437
4524
|
"docs": {
|
|
4438
4525
|
"stability": "stable",
|
|
4439
|
-
"summary": "VPC configuration
|
|
4526
|
+
"summary": "Lambda VPC configuration."
|
|
4440
4527
|
},
|
|
4441
|
-
"fqn": "@cxbuilder/flow-config.
|
|
4528
|
+
"fqn": "@cxbuilder/flow-config.LambdaVpcConfig",
|
|
4442
4529
|
"kind": "interface",
|
|
4443
4530
|
"locationInModule": {
|
|
4444
4531
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4445
|
-
"line":
|
|
4532
|
+
"line": 56
|
|
4446
4533
|
},
|
|
4447
|
-
"name": "
|
|
4534
|
+
"name": "LambdaVpcConfig",
|
|
4448
4535
|
"properties": [
|
|
4449
4536
|
{
|
|
4450
4537
|
"abstract": true,
|
|
@@ -4455,9 +4542,9 @@
|
|
|
4455
4542
|
"immutable": true,
|
|
4456
4543
|
"locationInModule": {
|
|
4457
4544
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4458
|
-
"line":
|
|
4545
|
+
"line": 65
|
|
4459
4546
|
},
|
|
4460
|
-
"name": "
|
|
4547
|
+
"name": "securityGroupIds",
|
|
4461
4548
|
"type": {
|
|
4462
4549
|
"collection": {
|
|
4463
4550
|
"elementtype": {
|
|
@@ -4476,30 +4563,9 @@
|
|
|
4476
4563
|
"immutable": true,
|
|
4477
4564
|
"locationInModule": {
|
|
4478
4565
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4479
|
-
"line":
|
|
4480
|
-
},
|
|
4481
|
-
"name": "privateSubnetIds",
|
|
4482
|
-
"type": {
|
|
4483
|
-
"collection": {
|
|
4484
|
-
"elementtype": {
|
|
4485
|
-
"primitive": "string"
|
|
4486
|
-
},
|
|
4487
|
-
"kind": "array"
|
|
4488
|
-
}
|
|
4489
|
-
}
|
|
4490
|
-
},
|
|
4491
|
-
{
|
|
4492
|
-
"abstract": true,
|
|
4493
|
-
"docs": {
|
|
4494
|
-
"stability": "stable",
|
|
4495
|
-
"summary": "Security group IDs for VPC endpoints."
|
|
4496
|
-
},
|
|
4497
|
-
"immutable": true,
|
|
4498
|
-
"locationInModule": {
|
|
4499
|
-
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4500
|
-
"line": 60
|
|
4566
|
+
"line": 70
|
|
4501
4567
|
},
|
|
4502
|
-
"name": "
|
|
4568
|
+
"name": "subnetIds",
|
|
4503
4569
|
"type": {
|
|
4504
4570
|
"collection": {
|
|
4505
4571
|
"elementtype": {
|
|
@@ -4518,7 +4584,7 @@
|
|
|
4518
4584
|
"immutable": true,
|
|
4519
4585
|
"locationInModule": {
|
|
4520
4586
|
"filename": "infrastructure/FlowConfigStack.ts",
|
|
4521
|
-
"line":
|
|
4587
|
+
"line": 60
|
|
4522
4588
|
},
|
|
4523
4589
|
"name": "vpcId",
|
|
4524
4590
|
"type": {
|
|
@@ -4526,9 +4592,9 @@
|
|
|
4526
4592
|
}
|
|
4527
4593
|
}
|
|
4528
4594
|
],
|
|
4529
|
-
"symbolId": "infrastructure/FlowConfigStack:
|
|
4595
|
+
"symbolId": "infrastructure/FlowConfigStack:LambdaVpcConfig"
|
|
4530
4596
|
}
|
|
4531
4597
|
},
|
|
4532
|
-
"version": "
|
|
4533
|
-
"fingerprint": "
|
|
4598
|
+
"version": "2.0.0",
|
|
4599
|
+
"fingerprint": "mEFp1ROr+Au/ufIID0Esh7NWFl2JNdCBQ+JSyXCGr3o="
|
|
4534
4600
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,26 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [2.0.0] - 2025-07-16
|
|
9
|
+
|
|
10
|
+
- Add an admin page where users can select available locale an available voice ids.
|
|
11
|
+
- Add ability to import/export configs
|
|
12
|
+
- Fix Private API GW URL
|
|
13
|
+
- Sort flows/prompts/variables by name
|
|
14
|
+
- Add ability to remove CXBuilder branding from frontend
|
|
15
|
+
|
|
16
|
+
### v2.0.0 Breaking Changes
|
|
17
|
+
|
|
18
|
+
- Changed DDB from `Table` to `TableV2` to better support ACGR
|
|
19
|
+
- Mitigation: **Backup existing Flow Config table and delete it. Deploy the new version of the app. Restore your table backup.**
|
|
20
|
+
- Removed the `-get-config` suffix from the Amazon Connect lambda to reduce function name length. Lambda name now matches the app prefix.
|
|
21
|
+
- Mitigation: Update your flows accordingly
|
|
22
|
+
- Use `event.Details.ContactData.LanguageCode` instead of `event.Details.ContactData.Attributes.lang`
|
|
23
|
+
- Mitigation: take advantage fo the LanguageCode feature instead of using a `lang` attribute
|
|
24
|
+
- The `lang` parameter is still available for backwards compatibility - will be removed in a future version
|
|
25
|
+
- Split VPC configuration parameters into: `apiVpcConfig` and `lambdaVpcConfig`
|
|
26
|
+
- Mitigation: migrate to the new props
|
|
27
|
+
|
|
8
28
|
## [1.1.0] - 2025-06-23
|
|
9
29
|
|
|
10
30
|
### Added
|
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @cxbuilder/flow-config
|
|
2
2
|
|
|
3
|
+
[](https://github.com/cxbuilder/flow-config/actions/workflows/ci-cd.yml)
|
|
4
|
+
[](https://badge.fury.io/js/@cxbuilder%2Fflow-config)
|
|
5
|
+
[](https://badge.fury.io/py/cxbuilder-flow-config)
|
|
6
|
+
[](https://constructs.dev/packages/@cxbuilder/flow-config)
|
|
7
|
+
|
|
3
8
|
AWS CDK constructs for Amazon Connect FlowConfig - a third-party app for configuring variables and prompts in Connect contact flows.
|
|
4
9
|
|
|
5
10
|
## Links
|
|
@@ -162,9 +167,7 @@ The Lambda function handles Amazon Connect Contact Flow events with the followin
|
|
|
162
167
|
},
|
|
163
168
|
"ContactData": {
|
|
164
169
|
"Channel": "VOICE",
|
|
165
|
-
"
|
|
166
|
-
"lang": "en-US"
|
|
167
|
-
}
|
|
170
|
+
"LanguageCode": "en-US"
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
173
|
}
|
|
@@ -180,7 +183,7 @@ The Lambda function handles Amazon Connect Contact Flow events with the followin
|
|
|
180
183
|
2. **Optional Language Selection** (in order of precedence):
|
|
181
184
|
|
|
182
185
|
- `Details.Parameters.lang` (highest priority)
|
|
183
|
-
- `Details.ContactData.
|
|
186
|
+
- `Details.ContactData.LanguageCode`
|
|
184
187
|
- Defaults to `"en-US"`
|
|
185
188
|
|
|
186
189
|
3. **Channel Detection**:
|
|
@@ -227,7 +230,7 @@ For direct testing or non-Connect invocation:
|
|
|
227
230
|
### Setting Up in Contact Flow
|
|
228
231
|
|
|
229
232
|
1. **Add "Invoke AWS Lambda function" block** to your contact flow
|
|
230
|
-
2. **Select the GetConfig Lambda function** (deployed as `${prefix}
|
|
233
|
+
2. **Select the GetConfig Lambda function** (deployed as `${prefix}`)
|
|
231
234
|
3. **Configure parameters**:
|
|
232
235
|
|
|
233
236
|
```json
|
|
@@ -260,7 +260,8 @@ async function listFlowConfigs(event, claims) {
|
|
|
260
260
|
TableName: env.FLOW_CONFIGS_TABLE_NAME
|
|
261
261
|
});
|
|
262
262
|
const response = await docClient.send(scanCommand);
|
|
263
|
-
const
|
|
263
|
+
const allItems = response.Items || [];
|
|
264
|
+
const flowConfigs = allItems.filter((item) => item.id !== "application-settings");
|
|
264
265
|
const pattern = event.queryStringParameters?.pattern;
|
|
265
266
|
let filteredConfigs = flowConfigs;
|
|
266
267
|
if (pattern) {
|