Skip to content

Commit

Permalink
Merge pull request #322 from customer-dynamics/release/v2.1.0
Browse files Browse the repository at this point in the history
release: v2.1.0
  • Loading branch information
hendrickson-tyler committed Aug 20, 2024
2 parents a1d7c1a + ef9b61f commit f2f9c04
Show file tree
Hide file tree
Showing 31 changed files with 2,710 additions and 2,439 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ jobs:
"subjectLookup": "required-editable"
},
"options": {
"codeSigning": true
"codeSigning": true,
"ivrSpeaking": {
"rate": "medium",
"volume": "medium"
}
},
"logoUrl": "placeholder",
"supportPhone": "placeholder",
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ lib/lambda/subject-lookup-policy.js
*.d.ts
node_modules
.context-values.json
.*.context-values.json
exports
.DS_Store

Expand Down
2 changes: 1 addition & 1 deletion bin/c3-amazon-connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function getMostRecentGitTag(): Promise<string> {
return stdout.trim();
} catch (error) {
console.error('Error fetching the most recent git tag:', error);
return 'v2.0.0';
return 'v2.1.0';
}
}

Expand Down
6 changes: 5 additions & 1 deletion cdk.context.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"subjectLookup": ""
},
"options": {
"codeSigning": true
"codeSigning": true,
"ivrSpeaking": {
"rate": "medium",
"volume": "medium"
}
},
"logoUrl": "",
"supportPhone": "",
Expand Down
8 changes: 5 additions & 3 deletions docs/GETTING-STARTED.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ In order to facilitate this process, you will need to provide some values to the

##### Options

| Value | Description |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `codeSigning` | Whether to support code signing for Lambda resources. This is recommended for security purposes, but may be disabled if necessary. |
| Value | Description |
| -------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| `codeSigning` | Whether to support code signing for Lambda resources. This is recommended for security purposes, but may be disabled if necessary. |
| `ivrSpeaking.rate` | The speed at which the IVR voice speaks. Valid options are `"x-slow"`, `"slow"`, `"medium"`, `"fast"`, and `"x-fast"`. |
| `ivrSpeaking.volume` | The volume at which the IVR voice speaks. Valid options are `"x-soft"`, `"soft"`, `"medium"`, `"loud"` and `"x-loud"`. |

##### Other

Expand Down
2 changes: 2 additions & 0 deletions lib/c3-amazon-connect-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export class C3AmazonConnectStack extends Stack {
this.tokenizeTransactionFunction,
this.submitPaymentFunction,
this.sendReceiptFunction,
this.validateEntryFunction,
);
}
if (this.featuresContext.agentAssistedIVR) {
Expand All @@ -118,6 +119,7 @@ export class C3AmazonConnectStack extends Stack {
this.tokenizeTransactionFunction,
this.submitPaymentFunction,
this.sendReceiptFunction,
this.validateEntryFunction,
);
}
if (this.featuresContext.subjectLookup) {
Expand Down
44 changes: 41 additions & 3 deletions lib/connect/content-transformations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Function } from 'aws-cdk-lib/aws-lambda';
import * as flowModuleJson from './flows/modules/c3-payment-ivr-flow-module.json';
import * as agentAssistedPaymentIVRFlowJson from './flows/c3-agent-assisted-payment-ivr-flow.json';
import * as subjectLookupFlow from './flows/c3-subject-lookup-flow.json';
import { IvrSpeakingContext } from '../models';

/**
* Gets the content for the payment IVR flow module.
Expand All @@ -10,19 +11,23 @@ import * as subjectLookupFlow from './flows/c3-subject-lookup-flow.json';
* @param tokenizeTransactionLambdaArn The Lambda function that tokenizes a transaction.
* @param submitPaymentLambdaArn The Lambda function that submits a payment.
* @param sendReceiptLambdaArn The Lambda function that sends a receipt.
* @param validateEntryLambdaArn The Lambda function that validates the user's entry.
* @param amazonConnectSecurityKeyId The security key ID for Amazon Connect.
* @param amazonConnectSecurityKeyCertificateContent The security key certificate content for Amazon Connect.
* @param amazonConnectReceiptQueueArn The ARN for the Amazon Connect receipt queue.
* @param ivrSpeakingContext The speaking context for the IVR.
* @returns A string representing the content for the base IVR payment flow module.
*/
export function getPaymentIVRFlowModuleContent(
createPaymentRequestLambdaFunction: Function,
tokenizeTransactionLambdaFunction: Function,
submitPaymentLambdaFunction: Function,
sendReceiptLambdaFunction: Function,
validateEntryLambdaFunction: Function,
amazonConnectSecurityKeyId: string,
amazonConnectSecurityKeyCertificateContent: string,
amazonConnectReceiptQueueArn: string,
ivrSpeakingContext: IvrSpeakingContext,
) {
let transformedContent = JSON.stringify(flowModuleJson);

Expand All @@ -43,6 +48,10 @@ export function getPaymentIVRFlowModuleContent(
/<<sendReceiptLambdaArn>>/g,
sendReceiptLambdaFunction.functionArn,
);
transformedContent = transformedContent.replace(
/<<validateEntryLambdaArn>>/g,
validateEntryLambdaFunction.functionArn,
);

// Replace Amazon Connect security key placeholders with actual values.
transformedContent = transformedContent.replace(
Expand All @@ -55,15 +64,27 @@ export function getPaymentIVRFlowModuleContent(
);

// Replace the receipt queue ID placeholder with the actual value.
const queueId = amazonConnectReceiptQueueArn.split('/queue/').pop();
if (!queueId) {
throw new Error('Invalid ARN for the receipt queue.');
let queueId = 'NULL';
if (amazonConnectReceiptQueueArn) {
queueId = amazonConnectReceiptQueueArn.split('/queue/').pop() ?? 'NULL';
if (!queueId) {
throw new Error('Invalid ARN for the receipt queue.');
}
}
transformedContent = transformedContent.replace(
/<<receiptQueueId>>/g,
queueId,
);

transformedContent = transformedContent.replace(
/<<speakingRate>>/g,
ivrSpeakingContext.rate,
);
transformedContent = transformedContent.replace(
/<<speakingVolume>>/g,
ivrSpeakingContext.volume,
);

return transformedContent;
}

Expand All @@ -75,8 +96,10 @@ export function getPaymentIVRFlowModuleContent(
* @param tokenizeTransactionFunction The Lambda function that tokenizes a transaction.
* @param submitPaymentLambdaFunction The Lambda function that submits a payment.
* @param sendReceiptLambdaFunction The Lambda function that sends a receipt.
* @param validateEntryLambdaFunction The Lambda function that validates the user's entry.
* @param amazonConnectSecurityKeyId The security key ID for Amazon Connect.
* @param amazonConnectSecurityKeyCertificateContent The security key certificate content for Amazon Connect.
* @param ivrSpeakingContext The speaking context for the IVR.
* @returns A string representing the content for the base IVR payment flow.
*/
export function getSelfServicePaymentIVRFlowContent(
Expand All @@ -85,8 +108,10 @@ export function getSelfServicePaymentIVRFlowContent(
tokenizeTransactionFunction: Function,
submitPaymentLambdaFunction: Function,
sendReceiptLambdaFunction: Function,
validateEntryLambdaFunction: Function,
amazonConnectSecurityKeyId: string,
amazonConnectSecurityKeyCertificateContent: string,
ivrSpeakingContext: IvrSpeakingContext,
) {
let transformedContent = JSON.stringify(agentAssistedPaymentIVRFlowJson);

Expand All @@ -111,6 +136,10 @@ export function getSelfServicePaymentIVRFlowContent(
/<<sendReceiptLambdaArn>>/g,
sendReceiptLambdaFunction.functionArn,
);
transformedContent = transformedContent.replace(
/<<validateEntryLambdaArn>>/g,
validateEntryLambdaFunction.functionArn,
);

// Replace Amazon Connect security key placeholders with actual values.
transformedContent = transformedContent.replace(
Expand All @@ -121,6 +150,15 @@ export function getSelfServicePaymentIVRFlowContent(
/<<amazonConnectSecurityKeyCertificateContent>>/g,
amazonConnectSecurityKeyCertificateContent,
);

transformedContent = transformedContent.replace(
/<<speakingRate>>/g,
ivrSpeakingContext.rate,
);
transformedContent = transformedContent.replace(
/<<speakingVolume>>/g,
ivrSpeakingContext.volume,
);
return transformedContent;
}

Expand Down
Loading

0 comments on commit f2f9c04

Please sign in to comment.