@cxbuilder/flow-config 1.1.0 → 2.1.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.
Files changed (33) hide show
  1. package/.jsii +151 -66
  2. package/CHANGELOG.md +24 -0
  3. package/README.md +8 -5
  4. package/dist/backend/FlowConfig/index.js +2 -1
  5. package/dist/backend/FlowConfig/index.js.map +2 -2
  6. package/dist/backend/GetConfig/index.js +1 -1
  7. package/dist/backend/GetConfig/index.js.map +2 -2
  8. package/dist/backend/Init/index.js +2 -1
  9. package/dist/backend/Init/index.js.map +2 -2
  10. package/dist/backend/Settings/index.js +255 -0
  11. package/dist/backend/Settings/index.js.map +7 -0
  12. package/dist/backend/Static/static/assets/index-Cejunttu.js +61 -0
  13. package/dist/backend/Static/static/assets/{index-NRh8x3FI.css → index-SZuscj14.css} +1 -1
  14. package/dist/backend/Static/static/index.html +3 -3
  15. package/dist/infrastructure/FlowConfigStack.d.ts +39 -15
  16. package/dist/infrastructure/FlowConfigStack.js +32 -20
  17. package/dist/infrastructure/GetConfig/index.js +2 -2
  18. package/dist/infrastructure/api/Api.d.ts +5 -2
  19. package/dist/infrastructure/api/Api.js +21 -15
  20. package/dist/infrastructure/api/Init/Init.interface.d.ts +4 -0
  21. package/dist/infrastructure/api/Init/Init.interface.js +1 -1
  22. package/dist/infrastructure/api/Init/index.js +2 -1
  23. package/dist/infrastructure/api/Settings/Settings.interface.d.ts +3 -0
  24. package/dist/infrastructure/api/Settings/Settings.interface.js +3 -0
  25. package/dist/infrastructure/api/Settings/index.d.ts +7 -0
  26. package/dist/infrastructure/api/Settings/index.js +21 -0
  27. package/dist/infrastructure/api/spec.yaml +122 -0
  28. package/dist/infrastructure/createLambda.js +1 -1
  29. package/dist/infrastructure/index.d.ts +1 -1
  30. package/dist/infrastructure/index.js +1 -1
  31. package/dist/infrastructure/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +1 -1
  33. 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[![CI/CD Pipeline](https://github.com/cxbuilder/flow-config/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/cxbuilder/flow-config/actions/workflows/ci-cd.yml)\n[![npm version](https://badge.fury.io/js/@cxbuilder%2Fflow-config.svg)](https://badge.fury.io/js/@cxbuilder%2Fflow-config)\n[![PyPI version](https://badge.fury.io/py/cxbuilder-flow-config.svg)](https://badge.fury.io/py/cxbuilder-flow-config)\n[![View on Construct Hub](https://constructs.dev/badge?package=%40cxbuilder%2Fflow-config)](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": 143
4138
+ "line": 169
4089
4139
  },
4090
4140
  "parameters": [
4091
4141
  {
@@ -4111,17 +4161,17 @@
4111
4161
  "kind": "class",
4112
4162
  "locationInModule": {
4113
4163
  "filename": "infrastructure/FlowConfigStack.ts",
4114
- "line": 118
4164
+ "line": 145
4115
4165
  },
4116
4166
  "methods": [
4117
4167
  {
4118
4168
  "docs": {
4119
4169
  "stability": "stable",
4120
- "summary": "Associated Voicemail as Agent Workspace app."
4170
+ "summary": "Associate FlowConfig as Agent Workspace app."
4121
4171
  },
4122
4172
  "locationInModule": {
4123
4173
  "filename": "infrastructure/FlowConfigStack.ts",
4124
- "line": 267
4174
+ "line": 295
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": 207
4184
+ "line": 235
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": 235
4200
+ "line": 263
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": 138
4214
+ "line": 165
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": 122
4227
+ "line": 149
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": 146
4240
+ "line": 172
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": 123
4253
+ "line": 150
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": 119
4266
+ "line": 146
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": 121
4279
+ "line": 148
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": 89
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": 100
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": 94
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": 95
4350
+ "line": 105
4301
4351
  },
4302
4352
  "name": "connectInstanceArn",
4303
4353
  "type": {
@@ -4307,19 +4357,75 @@
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": 93
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
+ "remarks": "Set to false to disable automatic association.",
4397
+ "stability": "stable",
4398
+ "summary": "Whether to associate the app with the Connect Agent Workspace."
4399
+ },
4400
+ "immutable": true,
4401
+ "locationInModule": {
4402
+ "filename": "infrastructure/FlowConfigStack.ts",
4403
+ "line": 142
4404
+ },
4405
+ "name": "associate3pApp",
4406
+ "optional": true,
4407
+ "type": {
4408
+ "primitive": "boolean"
4409
+ }
4410
+ },
4411
+ {
4412
+ "abstract": true,
4413
+ "docs": {
4414
+ "default": "true",
4415
+ "stability": "stable",
4416
+ "summary": "Set to false to remove CXBuilder branding from the web app."
4417
+ },
4418
+ "immutable": true,
4419
+ "locationInModule": {
4420
+ "filename": "infrastructure/FlowConfigStack.ts",
4421
+ "line": 135
4422
+ },
4423
+ "name": "branding",
4424
+ "optional": true,
4425
+ "type": {
4426
+ "primitive": "boolean"
4427
+ }
4428
+ },
4323
4429
  {
4324
4430
  "abstract": true,
4325
4431
  "docs": {
@@ -4330,7 +4436,7 @@
4330
4436
  "immutable": true,
4331
4437
  "locationInModule": {
4332
4438
  "filename": "infrastructure/FlowConfigStack.ts",
4333
- "line": 115
4439
+ "line": 129
4334
4440
  },
4335
4441
  "name": "globalTable",
4336
4442
  "optional": true,
@@ -4341,35 +4447,35 @@
4341
4447
  {
4342
4448
  "abstract": true,
4343
4449
  "docs": {
4344
- "stability": "stable"
4450
+ "remarks": "Note: VPC should contain endpoints to: CloudFormation, Lambda, DynamoDB, SNS, and Polly.",
4451
+ "stability": "stable",
4452
+ "summary": "If provided, the Lambda functions will be deployed in a VPC."
4345
4453
  },
4346
4454
  "immutable": true,
4347
4455
  "locationInModule": {
4348
4456
  "filename": "infrastructure/FlowConfigStack.ts",
4349
- "line": 101
4457
+ "line": 122
4350
4458
  },
4351
- "name": "prod",
4459
+ "name": "lambdaVpcConfig",
4352
4460
  "optional": true,
4353
4461
  "type": {
4354
- "primitive": "boolean"
4462
+ "fqn": "@cxbuilder/flow-config.LambdaVpcConfig"
4355
4463
  }
4356
4464
  },
4357
4465
  {
4358
4466
  "abstract": true,
4359
4467
  "docs": {
4360
- "remarks": "If provided, the application will be configured for VPC-only access.\nIf undefined, uses the current public configuration.",
4361
- "stability": "stable",
4362
- "summary": "VPC configuration for private deployment."
4468
+ "stability": "stable"
4363
4469
  },
4364
4470
  "immutable": true,
4365
4471
  "locationInModule": {
4366
4472
  "filename": "infrastructure/FlowConfigStack.ts",
4367
- "line": 108
4473
+ "line": 111
4368
4474
  },
4369
- "name": "vpc",
4475
+ "name": "prod",
4370
4476
  "optional": true,
4371
4477
  "type": {
4372
- "fqn": "@cxbuilder/flow-config.VpcConfig"
4478
+ "primitive": "boolean"
4373
4479
  }
4374
4480
  }
4375
4481
  ],
@@ -4386,7 +4492,7 @@
4386
4492
  "kind": "interface",
4387
4493
  "locationInModule": {
4388
4494
  "filename": "infrastructure/FlowConfigStack.ts",
4389
- "line": 66
4495
+ "line": 76
4390
4496
  },
4391
4497
  "name": "GlobalTableConfig",
4392
4498
  "properties": [
@@ -4399,7 +4505,7 @@
4399
4505
  "immutable": true,
4400
4506
  "locationInModule": {
4401
4507
  "filename": "infrastructure/FlowConfigStack.ts",
4402
- "line": 70
4508
+ "line": 80
4403
4509
  },
4404
4510
  "name": "isPrimaryRegion",
4405
4511
  "type": {
@@ -4415,7 +4521,7 @@
4415
4521
  "immutable": true,
4416
4522
  "locationInModule": {
4417
4523
  "filename": "infrastructure/FlowConfigStack.ts",
4418
- "line": 76
4524
+ "line": 86
4419
4525
  },
4420
4526
  "name": "replicaRegions",
4421
4527
  "optional": true,
@@ -4431,20 +4537,20 @@
4431
4537
  ],
4432
4538
  "symbolId": "infrastructure/FlowConfigStack:GlobalTableConfig"
4433
4539
  },
4434
- "@cxbuilder/flow-config.VpcConfig": {
4540
+ "@cxbuilder/flow-config.LambdaVpcConfig": {
4435
4541
  "assembly": "@cxbuilder/flow-config",
4436
4542
  "datatype": true,
4437
4543
  "docs": {
4438
4544
  "stability": "stable",
4439
- "summary": "VPC configuration for private deployment using string IDs."
4545
+ "summary": "Lambda VPC configuration."
4440
4546
  },
4441
- "fqn": "@cxbuilder/flow-config.VpcConfig",
4547
+ "fqn": "@cxbuilder/flow-config.LambdaVpcConfig",
4442
4548
  "kind": "interface",
4443
4549
  "locationInModule": {
4444
4550
  "filename": "infrastructure/FlowConfigStack.ts",
4445
- "line": 41
4551
+ "line": 56
4446
4552
  },
4447
- "name": "VpcConfig",
4553
+ "name": "LambdaVpcConfig",
4448
4554
  "properties": [
4449
4555
  {
4450
4556
  "abstract": true,
@@ -4455,9 +4561,9 @@
4455
4561
  "immutable": true,
4456
4562
  "locationInModule": {
4457
4563
  "filename": "infrastructure/FlowConfigStack.ts",
4458
- "line": 50
4564
+ "line": 65
4459
4565
  },
4460
- "name": "lambdaSecurityGroupIds",
4566
+ "name": "securityGroupIds",
4461
4567
  "type": {
4462
4568
  "collection": {
4463
4569
  "elementtype": {
@@ -4476,30 +4582,9 @@
4476
4582
  "immutable": true,
4477
4583
  "locationInModule": {
4478
4584
  "filename": "infrastructure/FlowConfigStack.ts",
4479
- "line": 55
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
4585
+ "line": 70
4501
4586
  },
4502
- "name": "vpcEndpointSecurityGroupIds",
4587
+ "name": "subnetIds",
4503
4588
  "type": {
4504
4589
  "collection": {
4505
4590
  "elementtype": {
@@ -4518,7 +4603,7 @@
4518
4603
  "immutable": true,
4519
4604
  "locationInModule": {
4520
4605
  "filename": "infrastructure/FlowConfigStack.ts",
4521
- "line": 45
4606
+ "line": 60
4522
4607
  },
4523
4608
  "name": "vpcId",
4524
4609
  "type": {
@@ -4526,9 +4611,9 @@
4526
4611
  }
4527
4612
  }
4528
4613
  ],
4529
- "symbolId": "infrastructure/FlowConfigStack:VpcConfig"
4614
+ "symbolId": "infrastructure/FlowConfigStack:LambdaVpcConfig"
4530
4615
  }
4531
4616
  },
4532
- "version": "1.1.0",
4533
- "fingerprint": "HFZB1viUfyeGHk8/FgKUYwz6TaxogYZ+PsdAxRdPVdA="
4617
+ "version": "2.1.0",
4618
+ "fingerprint": "7APV1MU2k9Svjp7XOp134U/3dAVzzVbNCFw80BjrU/4="
4534
4619
  }
package/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ 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.1.0] - 2025-10-08
9
+
10
+ - Added `associate3pApp` stack prop which allow you turn off the automatic Agent Workspace app association
11
+
12
+ ## [2.0.0] - 2025-07-30
13
+
14
+ - Add an admin page where users can select available locale an available voice ids.
15
+ - Add ability to import/export configs
16
+ - Fix Private API GW URL
17
+ - Sort flows/prompts/variables by name
18
+ - Add ability to remove CXBuilder branding from frontend
19
+
20
+ ### v2.0.0 Breaking Changes
21
+
22
+ - Changed DDB from `Table` to `TableV2` to better support ACGR
23
+ - Mitigation: **Backup existing Flow Config table and delete it. Deploy the new version of the app. Restore your table backup.**
24
+ - Removed the `-get-config` suffix from the Amazon Connect lambda to reduce function name length. Lambda name now matches the app prefix.
25
+ - Mitigation: Update your flows accordingly
26
+ - Use `event.Details.ContactData.LanguageCode` instead of `event.Details.ContactData.Attributes.lang`
27
+ - Mitigation: take advantage fo the LanguageCode feature instead of using a `lang` attribute
28
+ - The `lang` parameter is still available for backwards compatibility - will be removed in a future version
29
+ - Split VPC configuration parameters into: `apiVpcConfig` and `lambdaVpcConfig`
30
+ - Mitigation: migrate to the new props
31
+
8
32
  ## [1.1.0] - 2025-06-23
9
33
 
10
34
  ### Added
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # @cxbuilder/flow-config
2
2
 
3
+ [![CI/CD Pipeline](https://github.com/cxbuilder/flow-config/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/cxbuilder/flow-config/actions/workflows/ci-cd.yml)
4
+ [![npm version](https://badge.fury.io/js/@cxbuilder%2Fflow-config.svg)](https://badge.fury.io/js/@cxbuilder%2Fflow-config)
5
+ [![PyPI version](https://badge.fury.io/py/cxbuilder-flow-config.svg)](https://badge.fury.io/py/cxbuilder-flow-config)
6
+ [![View on Construct Hub](https://constructs.dev/badge?package=%40cxbuilder%2Fflow-config)](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
- "Attributes": {
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.Attributes.lang`
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}-get-config`)
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 flowConfigs = response.Items || [];
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) {