diff --git a/CHANGELOG.md b/CHANGELOG.md index 50471e8..f4caed6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.5.4] - 2023-03-30 +### Added + - [powershell/Search-ContactFlows/] Downloads and searches Amazon Connect contact flows for a specified String +### Changed + - [go/go.mod] Dependency Updates +## [1.5.3] - 2023-01-25 +### Changed + - [javascript/programmatically-create-task-example] Updating dependencies to address [CVE-1321](https://cwe.mitre.org/data/definitions/1321.html) +## [1.5.2] - 2023-01-25 +### Changed + - [tools/CCPLogParser] Updating dependencies to address [CVE-1321](https://cwe.mitre.org/data/definitions/1321.html) ## [1.5.3] - 2023-01-25 ### Changed - [javascript/programmatically-create-task-example] Updating dependencies to address [CVE-1321](https://cwe.mitre.org/data/definitions/1321.html) diff --git a/go/go.mod b/go/go.mod index b8ae91e..95e2df4 100644 --- a/go/go.mod +++ b/go/go.mod @@ -2,4 +2,4 @@ module github.com/amazon-connect/amazon-connect-samples/amazon-connect-snippets/ go 1.14 -require github.com/aws/aws-sdk-go v1.30.9 +require github.com/aws/aws-sdk-go v1.34.0 diff --git a/go/go.sum b/go/go.sum index 5f90153..ec0e434 100644 --- a/go/go.sum +++ b/go/go.sum @@ -1,16 +1,23 @@ -github.com/aws/aws-sdk-go v1.30.9 h1:DntpBUKkchINPDbhEzDRin1eEn1TG9TZFlzWPf0i8to= -github.com/aws/aws-sdk-go v1.30.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/aws/aws-sdk-go v1.34.0 h1:brux2dRrlwCF5JhTL7MUT3WUwo9zfDHZZp3+g3Mvlmo= +github.com/aws/aws-sdk-go v1.34.0/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc= github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2 h1:CCH4IOTTfewWjGOlSp+zGcjutRKlBEZQ6wTn8ozI/nI= golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= \ No newline at end of file diff --git a/powershell/Search-ContactFlows/Screen_Shot.png b/powershell/Search-ContactFlows/Screen_Shot.png new file mode 100644 index 0000000..0d774ac Binary files /dev/null and b/powershell/Search-ContactFlows/Screen_Shot.png differ diff --git a/powershell/Search-ContactFlows/Search-ContactFlows.ps1 b/powershell/Search-ContactFlows/Search-ContactFlows.ps1 new file mode 100644 index 0000000..dc13762 --- /dev/null +++ b/powershell/Search-ContactFlows/Search-ContactFlows.ps1 @@ -0,0 +1,56 @@ +# created by rpittfie@amazon.com on 12/15/2022: +# Download and search all contact flows for a specific string. +# +# Examples: +# +# ./Search-ContactFlows -SearchString "Lambda" +# Prompts you for which instance to download flows from and search the content of the downloaded contact flows for the string "Lambda" +# +# ./Search-ContactFlows -SearchString "Lambda" -DownloadFlows $false +# Search any already downloaded contact flows for the string "Lambda" + +Param( + [Parameter(Mandatory=$true)] + [string] $SearchString, + [boolean] $DownloadFlows = $true +) + +Write-Host "Importing AWS.Tools.Common. hang on a sec..." +Import-Module AWS.Tools.Common +Write-Host "Importing AWS.Tools.Connect. hang on a sec..." +Import-Module AWS.Tools.Connect + +if ($downloadFlows -eq $true) { + + if (!(Test-Path .\flows)) { + mkdir flows + } + Write-Host `n + Write-Host "Collecting a list of instances for the current region:" + Write-Host `n + $instances = Get-ConnInstanceList + for ($i = 0; $i -lt $instances.length; $i++) { + Write-Host $i $instances[$i].InstanceAlias + } + Write-Host `n + $instanceValue = Read-Host "Enter the number of the instance you'd like to collect contact flows for" + Write-Host `n + $instanceId = $instances[$instanceValue].Id + + #Write-Host $instanceId + + $flowList = Get-ConnContactFlowList -InstanceId $instanceId + + Write-Host "Downloading flows: " + Write-Host `n + foreach ($flow in $flowList) { + $flowDetails = Get-ConnContactFlow -InstanceId $instanceId -ContactFlowId $flow.Id -ErrorAction SilentlyContinue + $fileName = $flow.Name + $flowDetails.Content | Out-File .\flows\$fileName + Write-Host $flow.Name + } +} + +Write-Host `n +Write-Host "Searching contact flows for: $SearchString" +Get-ChildItem .\flows\* | select-string $SearchString | Select-Object Filename -Unique \ No newline at end of file diff --git a/powershell/Search-ContactFlows/readme.md b/powershell/Search-ContactFlows/readme.md new file mode 100644 index 0000000..bcaf150 --- /dev/null +++ b/powershell/Search-ContactFlows/readme.md @@ -0,0 +1,20 @@ +Downloads and searches Amazon Connect contact flows for a specified String. + +CloudShell instructions: + +1. Copy the script to CloudShell. +2. type in pwsh to start PowerShell +3. run the script: ./Search-ContactFlows.ps1 -SearchString "value" + +Screenshot below shows sample usage in CloudShell: + +![Screen_Shot](./Screen_Shot.png) + +Cloud9 instructions: + +1. Install PowerShell using the instructions here: https://learn.microsoft.com/en-us/powershell/scripting/install/install-other-linux?view=powershell-7.3 +2. run PowerShell by typing pwsh on the shell and hitting enter. +3. Type in Install-Module AWS.Tools.Common and wait for that to complete. +4. Type in Install-Module AWS.Tools.Connect and wait for that to complete. +5. Save the contents of this file to your Cloud9 folder +6. run the script: ./Search-ContactFlows.ps1 -SearchString "value" diff --git a/tools/CCPLogParser/package-lock.json b/tools/CCPLogParser/package-lock.json index 10e51c6..f904260 100644 --- a/tools/CCPLogParser/package-lock.json +++ b/tools/CCPLogParser/package-lock.json @@ -27096,39 +27096,6 @@ } } }, - "d3-geo": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/d3-geo/-/d3-geo-1.12.1.tgz", - "integrity": "sha512-XG4d1c/UJSEX9NfU02KwBL6BYPj8YKHxgBEw5om2ZnTRSbIcego6dhHwcxuSR3clxh0EpE38os1DVPOmnYtTPg==", - "requires": { - "d3-array": "1" - }, - "dependencies": { - "d3-array": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", - "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" - } - } - }, - "d3-geo-projection": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/d3-geo-projection/-/d3-geo-projection-2.9.0.tgz", - "integrity": "sha512-ZULvK/zBn87of5rWAfFMc9mJOipeSo57O+BBitsKIXmU4rTVAnX1kSsJkE0R+TxY8pGNoM1nbyRRE7GYHhdOEQ==", - "requires": { - "commander": "2", - "d3-array": "1", - "d3-geo": "^1.12.0", - "resolve": "^1.1.10" - }, - "dependencies": { - "d3-array": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/d3-array/-/d3-array-1.2.4.tgz", - "integrity": "sha512-KHW6M86R+FUPYGb3R5XiYjXPq7VzwxZ22buHhAEVG5ztoEcZZMLov530mmccaqA1GghZArjQV46fuc8kUqhhHw==" - } - } - }, "d3-hierarchy": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-1.1.9.tgz",