├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── PULL_REQUEST_TEMPLATE.md ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── NOTICE.txt ├── README.md ├── THIRD-PARTY-LICENSES.txt ├── deployment ├── build-open-source-dist.sh ├── build-s3-dist.sh ├── custom-deployment │ ├── .npmignore │ ├── bin │ │ ├── add_es_service_role_if_missing.sh │ │ ├── update-es-logs-and-client-stack-vars.sh │ │ └── update-pdf-lambda-code.sh │ ├── jest.config.js │ ├── test │ │ └── custom-deployment.test.ts │ └── tsconfig.json ├── document-understanding-cicd │ ├── index.js │ ├── package-lock.json │ └── package.json ├── document-understanding-solution.template ├── install_packages.sh └── logger │ ├── logger.common.js │ ├── package-lock.json │ ├── package.json │ └── test-setup.spec.js ├── images ├── DUS_Arch.png └── DUS_with_kendra.png └── source ├── .viperlightignore ├── app ├── components │ ├── Button │ │ ├── Button.js │ │ └── Button.module.scss │ ├── CameraCapture │ │ ├── CameraCapture.js │ │ └── CameraCapture.module.scss │ ├── Card │ │ ├── Card.js │ │ └── Card.module.scss │ ├── ContextModal │ │ ├── ContextModal.js │ │ └── ContextModal.module.scss │ ├── DocumentList │ │ ├── DocumentList.js │ │ └── DocumentList.module.scss │ ├── DocumentListItem │ │ ├── DocumentListItem.js │ │ └── DocumentListItem.module.scss │ ├── DocumentPreview │ │ ├── DocumentPreview.js │ │ └── DocumentPreview.module.scss │ ├── DocumentSearchBar │ │ ├── DocumentSearchBar.js │ │ └── DocumentSearchBar.module.scss │ ├── DocumentViewer │ │ ├── DocumentViewer.js │ │ └── DocumentViewer.module.scss │ ├── EntitiesCheckbox │ │ ├── EntitiesCheckbox.js │ │ └── EntitiesCheckbox.module.scss │ ├── FeatureTooltip │ │ ├── FeatureTooltip.js │ │ └── FeatureTooltip.module.scss │ ├── FileUpload │ │ ├── FileUpload.js │ │ └── FileUpload.module.scss │ ├── FormInput │ │ ├── FormInput.js │ │ └── FormInput.module.scss │ ├── Header │ │ ├── Header.js │ │ └── Header.module.scss │ ├── Highlight │ │ ├── Highlight.js │ │ └── Highlight.module.scss │ ├── KendraDocumentResults │ │ ├── KendraDocumentResults.js │ │ └── KendraDocumentResults.module.scss │ ├── KendraFAQItem │ │ ├── KendraFAQItem.js │ │ └── KendraFAQItem.module.scss │ ├── KendraFAQs │ │ ├── KendraFAQs.js │ │ └── KendraFAQs.module.scss │ ├── KendraHighlightedText │ │ ├── KendraHighlightedText.js │ │ └── KendraHighlightedText.module.scss │ ├── KendraResultFeedback │ │ ├── KendraResultFeedback.js │ │ └── KendraResultFeedback.module.scss │ ├── KendraResultFooter │ │ ├── KendraResultFooter.js │ │ └── KendraResultFooter.module.scss │ ├── KendraResultPage │ │ ├── KendraResultPage.js │ │ └── KendraResultPage.module.scss │ ├── KendraResultTitle │ │ ├── KendraResultTitle.js │ │ └── KendraResultTitle.module.scss │ ├── KendraResults │ │ ├── KendraResults.js │ │ └── KendraResults.module.scss │ ├── KendraTopResults │ │ ├── KendraTopResults.js │ │ └── KendraTopResults.module.scss │ ├── KeyValueList │ │ ├── KeyValueList.js │ │ └── KeyValueList.module.scss │ ├── LinkWithClickHandler │ │ └── LinkWithClickHandler.js │ ├── Loading │ │ ├── Loading.js │ │ └── Loading.module.scss │ ├── Modal │ │ ├── Modal.js │ │ └── Modal.module.scss │ ├── ModalContext │ │ └── ModalContext.js │ ├── Pager │ │ ├── Pager.js │ │ └── Pager.module.scss │ ├── PersonaInfoModal │ │ ├── PersonaInfoModal.js │ │ └── PersonaInfoModal.module.scss │ ├── PersonaLabel │ │ ├── PersonaLabel.js │ │ └── PersonaLabel.module.scss │ ├── PersonaSelector │ │ ├── PersonaSelector.js │ │ └── PersonaSelector.module.scss │ ├── RawTextLines │ │ ├── RawTextLines.js │ │ └── RawTextLines.module.scss │ ├── SampleCollections │ │ ├── SampleCollections.js │ │ └── SampleCollections.module.scss │ ├── SearchBar │ │ ├── SearchBar.js │ │ └── SearchBar.module.scss │ ├── SearchResults │ │ ├── SearchResults.js │ │ └── SearchResults.module.scss │ ├── SearchTypeTabs │ │ ├── SearchTypeTabs.js │ │ └── SearchTypeTabs.module.scss │ ├── Table │ │ ├── Table.js │ │ └── Table.module.scss │ ├── TableDownloader │ │ ├── TableDownloader.js │ │ └── TableDownloader.module.scss │ ├── TableResults │ │ ├── TableResults.js │ │ └── TableResults.module.scss │ ├── Tabs │ │ ├── Tabs.js │ │ └── Tabs.module.scss │ ├── TooltipButton │ │ ├── TooltipButton.js │ │ └── TooltipButton.module.scss │ └── TrackInfoModal │ │ ├── TrackInfoModal.js │ │ └── TrackInfoModal.module.scss ├── constants │ ├── action-types.js │ ├── configs.js │ └── test-data.js ├── pages │ ├── _app.js │ ├── _document.js │ ├── _error.js │ ├── app.scss │ ├── documents │ │ ├── documents.module.scss │ │ ├── index.js │ │ ├── view.js │ │ └── view.module.scss │ ├── error.module.scss │ ├── home.js │ ├── home.module.scss │ ├── index.js │ ├── login.module.scss │ ├── select.js │ ├── select.module.scss │ └── styleguide │ │ ├── index.js │ │ └── styleguide.module.scss ├── static │ ├── fonts │ │ ├── amazon-ember-md.woff │ │ ├── amazon-ember-md.woff2 │ │ ├── amazon-ember-mdit.woff │ │ ├── amazon-ember-mdit.woff2 │ │ ├── amazon-ember_bd.woff │ │ ├── amazon-ember_bd.woff2 │ │ ├── amazon-ember_bdit.woff │ │ ├── amazon-ember_bdit.woff2 │ │ ├── amazon-ember_rg.woff │ │ ├── amazon-ember_rg.woff2 │ │ ├── amazon-ember_rgit.woff │ │ └── amazon-ember_rgit.woff2 │ └── images │ │ ├── DUS_DEMO_logo_DarkBG.svg │ │ ├── DUS_DEMO_logo_WhiteBG.svg │ │ ├── Kendra_3Users-03.svg │ │ ├── background_header.svg │ │ ├── favicon.ico │ │ ├── general-public.png │ │ ├── general-public.svg │ │ ├── healthcare-provider.png │ │ ├── healthcare-provider.svg │ │ ├── icon_back.svg │ │ ├── icon_close.svg │ │ ├── icon_cloud-search.svg │ │ ├── icon_delete.svg │ │ ├── icon_delete_01.png │ │ ├── icon_document.svg │ │ ├── icon_error.svg │ │ ├── icon_feature.svg │ │ ├── icon_file-upload.svg │ │ ├── icon_home.svg │ │ ├── icon_next.svg │ │ ├── icon_pencil.svg │ │ ├── icon_previous.svg │ │ ├── icon_redact.svg │ │ ├── icon_search.svg │ │ ├── icon_success.svg │ │ ├── icon_tip.svg │ │ ├── icon_workflow.svg │ │ ├── logo_aws.svg │ │ ├── nofilter.svg │ │ ├── sample-previews │ │ ├── Lacey city bonds.png │ │ ├── employmentapp.png │ │ ├── expense.png │ │ ├── history.png │ │ └── management.png │ │ ├── scientist.png │ │ ├── scientist.svg │ │ ├── touch-icon-ipad-144-smile.png │ │ ├── touch-icon-iphone-114-smile.png │ │ └── user1.svg ├── store │ ├── entities │ │ ├── data.js │ │ ├── documents │ │ │ ├── actions.js │ │ │ ├── data.js │ │ │ └── selectors.js │ │ ├── meta │ │ │ ├── actions.js │ │ │ ├── data.js │ │ │ └── selectors.js │ │ ├── reducer.js │ │ ├── sampleDocuments │ │ │ ├── data.js │ │ │ └── selectors.js │ │ ├── searchResults │ │ │ ├── actions.js │ │ │ ├── data.js │ │ │ └── selectors.js │ │ └── tracks │ │ │ ├── data.js │ │ │ └── selectors.js │ ├── reducer.js │ ├── store.js │ └── ui │ │ ├── actions.js │ │ ├── data.js │ │ ├── reducer.js │ │ └── selectors.js ├── styles │ ├── _fonts.scss │ ├── global.scss │ ├── shared │ │ ├── _breakpoints.scss │ │ ├── _colors.scss │ │ ├── _grids.scss │ │ ├── _index.scss │ │ ├── _sizing.scss │ │ ├── _typography.scss │ │ └── _utils.scss │ └── vendor │ │ ├── _include-media.scss │ │ └── _normalize.scss └── utils │ ├── document.js │ ├── dus-constants.js │ └── link-generators.js ├── bin ├── config.js ├── deploy-backend.js ├── deploy-client-stack.js ├── pre-build.js ├── run-tests.sh └── upload-samples.sh ├── cdk.json ├── lambda ├── apiprocessor │ ├── document.py │ ├── documents.py │ ├── lambda_function.py │ ├── redact.py │ └── search.py ├── asyncprocessor │ ├── lambda_function.py │ └── models │ │ └── textract │ │ └── 2019-05-09 │ │ └── service-2.json ├── boto3 │ └── requirements.txt ├── customResourceKendraDataSource │ └── lambda_function.py ├── customResourceKendraIndex │ └── lambda_function.py ├── documentbulkprocessor │ └── lambda_function.py ├── documentprocessor │ └── lambda_function.py ├── elasticsearch │ └── requirements.txt ├── helper │ └── python │ │ ├── comprehendHelper.py │ │ ├── datastore.py │ │ ├── helper.py │ │ └── kendraHelper.py ├── joberrorhandler │ └── lambda_function.py ├── jobresultprocessor │ ├── lambda_function.py │ └── models │ │ └── textract │ │ └── 2019-05-09 │ │ └── service-2.json ├── kendraIndexPoller │ └── lambda_function.py ├── pdfgenerator │ ├── README.md │ └── searchable-pdf-1.0.jar ├── syncprocessor │ ├── lambda_function.py │ └── models │ │ └── textract │ │ └── 2019-05-09 │ │ └── service-2.json └── textractor │ └── python │ ├── og.py │ └── trp.py ├── lib ├── cdk-textract-client-stack.ts └── cdk-textract-stack.ts ├── license-report.txt ├── next.config.js ├── package-lock.json ├── package.json ├── samples ├── ClassicMode │ ├── Finance │ │ ├── Lacey city bonds.png │ │ ├── Spokane accounting.png │ │ ├── USDC balance sheet.png │ │ └── USDE balance sheet.png │ ├── Medical │ │ ├── HIPAA Release Form.pdf │ │ ├── Medical History Form.png │ │ ├── Medical Insurance Claim Form.pdf │ │ └── Medical Progress Tracker.png │ ├── Misc │ │ ├── employmentapp.png │ │ ├── expense.png │ │ └── management.png │ └── Research │ │ └── employmentapp.png └── KendraPdfs │ ├── documents │ ├── GeneralDocuments │ │ └── pdf │ │ │ ├── Causes_of_Chronic_Kidney_Disease_NIDDK.pdf │ │ │ ├── Chronic_Kidney_Disease_Tests_Diagnosis__NIDDK.pdf │ │ │ ├── Diabetes_Diet_Eating_and_Physical_Activity_NIDDK.pdf │ │ │ ├── Diabetes_Gum_Disease_and_Other_Dental_Problems_NIDDK.pdf │ │ │ ├── Diabetes_Heart_Disease_and_Stroke_NIDDK.pdf │ │ │ ├── Diabetes_Tests_and_Diagnosis_NIDDK.pdf │ │ │ ├── Eating_Right_for_Chronic_Kidney_Disease_NIDDK.pdf │ │ │ ├── High_Blood_Pressure_Kidney_Disease_NIDDK.pdf │ │ │ ├── Identify_Evaluate_Patients_with_Chronic_Kidney_Disease_NIDDK.pdf │ │ │ ├── Insulin_Medicines_and_Other_Diabetes_Treatments_NIDDK.pdf │ │ │ ├── Kidney_Transplant_NIDDK.pdf │ │ │ ├── Managing_Chronic_Kidney_Disease_NIDDK.pdf │ │ │ ├── Managing_Diabetes_NIDDK.pdf │ │ │ ├── Nutrition_for_Advanced_Chronic_Kidney_Disease_in_Adults_NIDDK.pdf │ │ │ ├── Pregnancy_if_You_Have_Diabetes_NIDDK.pdf │ │ │ ├── Preventing_Chronic_Kidney_Disease_NIDDK.pdf │ │ │ ├── Preventing_Diabetes_Problems_NIDDK.pdf │ │ │ ├── Preventing_Type_2_Diabetes_NIDDK.pdf │ │ │ ├── The_A1C_Test_Diabetes_NIDDK.pdf │ │ │ ├── What_If_My_Kidneys_Fail_NIDDK.pdf │ │ │ ├── What_Is_Chronic_Kidney_Disease_NIDDK.pdf │ │ │ └── What_is_Diabetes_NIDDK.pdf │ └── PersonaSpecific │ │ ├── GeneralPublic │ │ ├── pdf │ │ │ └── Creatine_Kinase_-_MedlinePlus_Medical_Test.pdf │ │ └── policy │ │ │ └── Creatine_Kinase_-_MedlinePlus_Medical_Test.pdf.metadata.json │ │ ├── HealthcareProvider │ │ ├── pdf │ │ │ ├── Muscular_Dystrophy_NIH.pdf │ │ │ └── What_is_Muscular_Dystrophy_-_CDC.pdf │ │ └── policy │ │ │ ├── Muscular_Dystrophy_NIH.pdf.metadata.json │ │ │ └── What_is_Muscular_Dystrophy_-_CDC.pdf.metadata.json │ │ └── Scientist │ │ ├── pdf │ │ ├── How_is_muscular_dystrophy_diagnosed__NICHD.pdf │ │ ├── Muscular_Dystrophy_Information_Page_National_Institute_of_Neurological_Disorders_and_Stroke.pdf │ │ └── Muscular_Dystrophy__Hope_Through_Research_-_National_Institute_Of_Neurological_Disorders_And_Stroke.pdf │ │ └── policy │ │ ├── How_is_muscular_dystrophy_diagnosed__NICHD.pdf.metadata.json │ │ ├── Muscular_Dystrophy_Hope_Through_Research_National_Institute_of_Neurological_Disorders_and_Stroke.pdf.metadata.json │ │ └── Muscular_Dystrophy_Information_Page_National_Institute_of_Neurological_Disorders_and_Stroke.pdf.metadata.json │ └── faqs │ └── medical_faq.csv ├── test-pre.js ├── test ├── test_datastore.py └── test_helper.py └── yarn.lock /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Please complete the following information about the solution:** 20 | - [ ] Version: [e.g. v1.0.0] 21 | - [ ] Region: [e.g. us-east-1] 22 | - [ ] Was the solution modified from the version published on this repository? 23 | - [ ] If the answer to the previous question was yes, are the changes available on GitHub? 24 | - [ ] Have you checked your [service quotas](https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html) for the sevices this solution uses? 25 | - [ ] Were there any errors in the CloudWatch Logs? 26 | 27 | **Screenshots** 28 | If applicable, add screenshots to help explain your problem (please **DO NOT include sensitive information**). 29 | 30 | **Additional context** 31 | Add any other context about the problem here. -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this solution 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the feature you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | *Issue #, if available:* 2 | 3 | *Description of changes:* 4 | 5 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 3 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 4 | opensource-codeofconduct@amazon.com with any additional questions or comments. 5 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | For full list of licenses, see: 4 | 5 | LICENSE.txt 6 | THIRD-PARTY-LICENSES.txt -------------------------------------------------------------------------------- /deployment/custom-deployment/.npmignore: -------------------------------------------------------------------------------- 1 | *.ts 2 | !*.d.ts 3 | 4 | # CDK asset staging directory 5 | .cdk.staging 6 | cdk.out 7 | -------------------------------------------------------------------------------- /deployment/custom-deployment/bin/add_es_service_role_if_missing.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | AWS_REGION=$(jq -r '.stack.region' ./package.json) 4 | 5 | echo "==Attempting to add service role to Amazon Elasticsearch in region $REGION==" 6 | $(aws iam create-service-linked-role --region $AWS_REGION --aws-service-name es.amazonaws.com && echo "Service role successfully added") || echo "Service role already exists" 7 | -------------------------------------------------------------------------------- /deployment/custom-deployment/bin/update-es-logs-and-client-stack-vars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source .env 4 | 5 | #STACK 6 | 7 | AWS_REGION=$(jq -r '.stack.region' ./package.json) 8 | 9 | echo "==update %%CLIENT_APP_BUCKET%% in stack with $2==" 10 | replace="s/%%CLIENT_APP_BUCKET%%/$ClientAppBucketName/g" 11 | sed -i -e $replace ./lib/cdk-textract-client-stack.js 12 | 13 | echo "==update Amazon Elasticsearch Cluster ($ElasticSearchCluster) with log streams to Log Groups: $ElasticSearchSearchLogGroup and $ElasticSearchIndexLogGroup" 14 | INDEX_LOG_ARN=$(aws logs describe-log-groups --region $AWS_REGION --log-group-name-prefix $ElasticSearchIndexLogGroup | jq -r '.logGroups[0].arn') 15 | SEARCH_LOG_ARN=$(aws logs describe-log-groups --region $AWS_REGION --log-group-name-prefix $ElasticSearchSearchLogGroup | jq -r '.logGroups[0].arn') 16 | 17 | echo "==adding permissions to ES service role first for creating log stream" 18 | aws logs put-resource-policy --region $AWS_REGION --policy-name es-to-log-stream --policy-document '{ "Version": "2012-10-17", "Statement": [ { "Sid": "ElasticSearchLogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "es.amazonaws.com" ] }, "Action":["logs:PutLogEvents", "logs:CreateLogStream", "logs:DeleteLogStream"], "Resource": "*" } ] }' 19 | 20 | echo "==Log Groups are $INDEX_LOG_ARN and $SEARCH_LOG_ARN" 21 | aws es update-elasticsearch-domain-config --region $AWS_REGION --domain-name $ElasticSearchCluster --log-publishing-options '{"INDEX_SLOW_LOGS": { "CloudWatchLogsLogGroupArn": "'"$INDEX_LOG_ARN"'", "Enabled": true }, "SEARCH_SLOW_LOGS": { "CloudWatchLogsLogGroupArn": "'"$SEARCH_LOG_ARN"'", "Enabled": true } }' 22 | -------------------------------------------------------------------------------- /deployment/custom-deployment/bin/update-pdf-lambda-code.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### Reuploads the pdfgenerator lambda code (does not get loaded properly during deploy ### 4 | 5 | source .env 6 | 7 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 8 | 9 | AWS_REGION=$(jq -r '.stack.region' ./package.json) 10 | 11 | (cd $DIR && 12 | cd ../../../source/lambda/pdfgenerator && 13 | aws lambda update-function-code --region=$AWS_REGION --function-name $PdfGenLambda --zip-file fileb://$PWD/searchable-pdf-1.0.jar) -------------------------------------------------------------------------------- /deployment/custom-deployment/jest.config.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | module.exports = { 16 | "roots": [ 17 | "/test" 18 | ], 19 | testMatch: [ '**/*.test.ts'], 20 | "transform": { 21 | "^.+\\.tsx?$": "ts-jest" 22 | }, 23 | } 24 | -------------------------------------------------------------------------------- /deployment/custom-deployment/test/custom-deployment.test.ts: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { expect as expectCDK, matchTemplate, MatchStyle } from '@aws-cdk/assert'; 16 | import cdk = require('@aws-cdk/core'); 17 | import CustomDeployment = require('../lib/custom-deployment-stack'); 18 | 19 | test('Empty Stack', () => { 20 | const app = new cdk.App(); 21 | // WHEN 22 | const stack = new CustomDeployment.CustomDeploymentStack(app, 'MyTestStack'); 23 | // THEN 24 | expectCDK(stack).to(matchTemplate({ 25 | "Resources": {} 26 | }, MatchStyle.EXACT)) 27 | }); -------------------------------------------------------------------------------- /deployment/custom-deployment/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2018", 4 | "module": "commonjs", 5 | "lib": ["es2016", "es2017.object", "es2017.string"], 6 | "declaration": true, 7 | "strict": true, 8 | "noImplicitAny": true, 9 | "strictNullChecks": true, 10 | "noImplicitThis": true, 11 | "alwaysStrict": true, 12 | "noUnusedLocals": false, 13 | "noUnusedParameters": false, 14 | "noImplicitReturns": true, 15 | "noFallthroughCasesInSwitch": false, 16 | "inlineSourceMap": true, 17 | "inlineSources": true, 18 | "experimentalDecorators": true, 19 | "strictPropertyInitialization": false, 20 | "typeRoots": ["./node_modules/@types"], 21 | "moduleResolution": "classic" 22 | }, 23 | "exclude": ["cdk.out"] 24 | } 25 | -------------------------------------------------------------------------------- /deployment/document-understanding-cicd/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cicd-helper", 3 | "version": "0.0.1", 4 | "description": "creates commit in users account with document understanding code artifact", 5 | "author": { 6 | "name": "aws-solutions-builder" 7 | }, 8 | "dependencies": { 9 | "adm-zip": "^0.4.13", 10 | "aws-sdk": "^2.1354.0", 11 | "logger": "file:../logger" 12 | }, 13 | "main": "index.js", 14 | "scripts": { 15 | "build:init": "rm -rf package-lock.json && rm -rf dist && rm -rf node_modules", 16 | "build:zip": "npm install && zip -rq ../document-understanding-cicd.zip . -x template.yml", 17 | "build:dist": "mkdir dist && mv document-understanding-cicd.zip dist/", 18 | "build": "npm run build:init && npm install --production && npm run build:zip && npm run build:dist" 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /deployment/install_packages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | current_dir="$PWD" 3 | echo $current_dir 4 | if [ ! -d $current_dir/lambda/boto3/python ] 5 | then 6 | echo "Installing boto3 and its dependencies..." 7 | mkdir $current_dir/lambda/boto3/python 8 | pip3 install -r $current_dir/lambda/boto3/requirements.txt --target=$current_dir/lambda/boto3/python --no-deps --no-cache-dir 9 | rm -r $current_dir/lambda/boto3/python/__pycache__ && rm -r $current_dir/lambda/boto3/python/bin 10 | else 11 | rm -r $current_dir/lambda/boto3/python/ 12 | mkdir $current_dir/lambda/boto3/python 13 | pip3 install -r $current_dir/lambda/boto3/requirements.txt --target=$current_dir/lambda/boto3/python --no-deps --no-cache-dir 14 | rm -r $current_dir/lambda/boto3/python/__pycache__ && rm -r $current_dir/lambda/boto3/python/bin 15 | fi 16 | cd $current_dir/lambda/boto3 17 | if [ ! -f boto3-layer.zip ] 18 | then 19 | zip -rq boto3-layer.zip python 20 | echo "Created boto3-layer.zip" 21 | else 22 | rm -rf boto3-layer.zip 23 | zip -rq boto3-layer.zip python 24 | echo "Created new boto3-layer.zip" 25 | fi 26 | if [ ! -d $current_dir/lambda/elasticsearch/python ] 27 | then 28 | echo "Installing elasticsearch and its dependencies..." 29 | mkdir $current_dir/lambda/elasticsearch/python 30 | pip3 install -r $current_dir/lambda/elasticsearch/requirements.txt --target=$current_dir/lambda/elasticsearch/python --no-deps --no-cache-dir 31 | else 32 | rm -r $current_dir/lambda/elasticsearch/python/ 33 | mkdir $current_dir/lambda/elasticsearch/python 34 | pip3 install -r $current_dir/lambda/elasticsearch/requirements.txt --target=$current_dir/lambda/elasticsearch/python --no-deps --no-cache-dir 35 | fi 36 | cd $current_dir/lambda/elasticsearch 37 | if [ ! -f es.zip ] 38 | then 39 | zip -rq es.zip python 40 | echo "Created es.zip" 41 | else 42 | rm -rf es.zip 43 | zip -rq es.zip python 44 | echo "Created new es.zip" 45 | fi -------------------------------------------------------------------------------- /deployment/logger/logger.common.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************* 2 | * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | /** 15 | * @author Solution Builders 16 | */ 17 | 18 | 'use strict'; 19 | 20 | // Logging class for sending messages to console log 21 | class Logger { 22 | constructor() {} 23 | 24 | static log(level, message) { 25 | if (level <= process.env.LOGGING_LEVEL) { 26 | console.log('[info] ', message); 27 | } 28 | } 29 | 30 | static warn(level, message) { 31 | if (level <= process.env.LOGGING_LEVEL) { 32 | console.log('[warn] ', message); 33 | } 34 | } 35 | 36 | static error(level, message) { 37 | if (level <= process.env.LOGGING_LEVEL) { 38 | console.log('[error] ', message); 39 | } 40 | } 41 | 42 | static get levels() { 43 | return { 44 | INFO: 1, 45 | ROBUST: 2, 46 | }; 47 | } 48 | } 49 | 50 | module.exports = Object.freeze(Logger); 51 | -------------------------------------------------------------------------------- /deployment/logger/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "logger", 3 | "version": "0.0.1", 4 | "description": "Logger is an auxiliary logging class for solution services", 5 | "author": { 6 | "name": "aws-solutions-builder" 7 | }, 8 | "private": true, 9 | "main": "./logger.common.js", 10 | "devDependencies": { 11 | "aws-sdk-mock": "*", 12 | "chai": "*", 13 | "mocha": "10.1.0", 14 | "npm-run-all": "*", 15 | "proxyquire": "*", 16 | "sinon": "*", 17 | "sinon-chai": "*" 18 | }, 19 | "scripts": { 20 | "pretest": "rm -rf package-lock.json && rm -rf node_modules && npm install", 21 | "test": "mocha *.spec.js", 22 | "prestart": "rm -rf package-lock.json && npm install", 23 | "start": "node index.js", 24 | "build:init": "rm -rf package-lock.json && rm -rf dist && rm -rf node_modules", 25 | "build": "npm run build:init && npm install --production" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /deployment/logger/test-setup.spec.js: -------------------------------------------------------------------------------- 1 | const sinon = require('sinon'); 2 | const chai = require('chai'); 3 | const sinonChai = require('sinon-chai'); 4 | 5 | before(function() { 6 | chai.use(sinonChai); 7 | }); 8 | 9 | beforeEach(function() { 10 | this.sandbox = sinon.sandbox.create(); 11 | }); 12 | 13 | afterEach(function() { 14 | this.sandbox.restore(); 15 | }); 16 | -------------------------------------------------------------------------------- /images/DUS_Arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/images/DUS_Arch.png -------------------------------------------------------------------------------- /images/DUS_with_kendra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/images/DUS_with_kendra.png -------------------------------------------------------------------------------- /source/.viperlightignore: -------------------------------------------------------------------------------- 1 | [node-yarnoutdated] 2 | @babel/helper-validator-identifier=7.18.6 3 | aws-amplify=4.3.46 4 | aws-cdk=1.203.0 5 | aws-sdk=2.1397.0 6 | date-fns=1.30.1 7 | dotenv=16.0.1 8 | eslint=8.33.0 9 | eslint-config-prettier=8.6.0 10 | inquirer=9.0.2 11 | next=12.2.4 12 | next-redux-wrapper=5.0.0 13 | node-fetch=3.2.10 14 | query-string=7.1.3 15 | ramda=0.28.0 16 | react=17.0.2 17 | react-dom=17.0.2 18 | react-pdf=4.2.0 19 | react-redux=8.0.7 20 | react-webcam=7.0.1 21 | redux-actions=2.6.5 22 | sass=1.54.0 23 | typescript=4.9.5 -------------------------------------------------------------------------------- /source/app/components/CameraCapture/CameraCapture.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import React, { useCallback, useRef } from 'react' 16 | import ReactDOM from 'react-dom' 17 | import Webcam from 'react-webcam' 18 | 19 | import css from './CameraCapture.module.scss' 20 | import Button from '../Button/Button' 21 | 22 | const videoConstraints = { 23 | facingMode: 'environment', 24 | } 25 | 26 | function CameraCapture({ onCapture, onCancel }) { 27 | const webcam = useRef() 28 | const capture = useCallback(() => { 29 | const canvas = webcam.current.getCanvas() 30 | canvas.toBlob(blob => { 31 | onCapture(blob) 32 | }, 'image/jpeg') 33 | }, [onCapture]) 34 | 35 | return ReactDOM.createPortal( 36 |
37 | 43 |
44 | 49 |
50 |
, 51 | document.body 52 | ) 53 | } 54 | 55 | export default CameraCapture 56 | -------------------------------------------------------------------------------- /source/app/components/CameraCapture/CameraCapture.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .cameraCapture { 4 | @include fixed(0, 0, 0, 0); 5 | z-index: 10; 6 | display: flex; 7 | flex-direction: column; 8 | background: #000; 9 | align-items: center; 10 | 11 | > video { 12 | flex: 1 1 0px; 13 | width: 100%; 14 | overflow: hidden; 15 | object-fit: contain; 16 | } 17 | 18 | .button { 19 | margin: 15px; 20 | width: 60px; 21 | height: 60px; 22 | background: white; 23 | border-radius: 50%; 24 | border: 5px solid white; 25 | box-shadow: inset 0 0 0 3px #000; 26 | } 27 | } 28 | 29 | .cancel { 30 | position: absolute; 31 | right: 1em; 32 | bottom: 30px; 33 | } 34 | -------------------------------------------------------------------------------- /source/app/components/Card/Card.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | $card-palettes: ( 4 | black: color(gray, 80), 5 | blue: color(blue, 20), 6 | teal: color(teal, 20), 7 | purple: color(purple, 20), 8 | ); 9 | 10 | // Card 11 | .card { 12 | display: flex; 13 | flex-direction: column; 14 | padding: rem(25); 15 | padding-top: rem(35); 16 | margin: rem(10); 17 | cursor: pointer; 18 | background-color: color(gray, 90); 19 | border: 1px solid color(gray, 60); 20 | border-radius: 10px; 21 | box-shadow: 0 0 2px rgba(color(black), 0.05); 22 | align-items: center; 23 | transition: all 250ms ease; 24 | 25 | &:focus, 26 | &:hover { 27 | border-color: color(gray, 60); 28 | outline: 0; 29 | transform: translateY(-2px); 30 | box-shadow: 0 2px 5px rgba(color(black), 0.15); 31 | } 32 | 33 | @include media-grid(4) { 34 | text-align: center; 35 | flex-direction: column; 36 | } 37 | } 38 | 39 | 40 | // Title 41 | .title { 42 | @include type-heading-h4(); 43 | margin: 0; 44 | text-align: center; 45 | 46 | .loud & { 47 | @include type-heading-h2(); 48 | } 49 | 50 | .quiet & { 51 | @include type-heading-h5(); 52 | } 53 | } 54 | 55 | // Subtitle 56 | .subtitle { 57 | margin: em(4) 0 0; 58 | text-align: center; 59 | 60 | .loud & { 61 | @include type-body-lead(); 62 | margin-top: 0; 63 | } 64 | 65 | .quiet & { 66 | @include type-body-secondary(); 67 | margin-top: 0; 68 | } 69 | } 70 | 71 | // Icon 72 | .icon { 73 | margin-bottom: rem(24); 74 | font-size: 0; 75 | 76 | @include media-grid(4) { 77 | margin-right: 0; 78 | margin-bottom: rem(24); 79 | } 80 | } 81 | 82 | // Palettes 83 | @each $palette, $color in $card-palettes { 84 | .#{$palette} { 85 | &:focus, 86 | &:hover { 87 | border-color: $color; 88 | } 89 | 90 | .title { 91 | color: $color; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /source/app/components/ContextModal/ContextModal.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React from "react"; 15 | import PropTypes from "prop-types"; 16 | import classNames from "classnames"; 17 | import css from "./ContextModal.module.scss"; 18 | 19 | Modal.propTypes = { 20 | children: PropTypes.node.isRequired, 21 | onClose: PropTypes.func.isRequired, 22 | show: PropTypes.bool.isRequired, 23 | modalTitle: PropTypes.string.isRequired, 24 | }; 25 | export default function Modal({ children, onClose, show, modalTitle }) { 26 | const modalClassNames = classNames(css.modal); 27 | if (!show) { 28 | return null; 29 | } 30 | return ( 31 | show && ( 32 | 45 | ) 46 | ); 47 | } 48 | -------------------------------------------------------------------------------- /source/app/components/ContextModal/ContextModal.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .modal { 4 | position: fixed; 5 | width: 100%; 6 | height: 100%; 7 | left: 0; 8 | top: 0; 9 | right: 0; 10 | bottom: 0; 11 | opacity: 1; 12 | flex: 1; 13 | justify-content: center; 14 | background-color:rgba(255, 255, 255, 0.5);; 15 | align-content: center; 16 | transition: 1.1s ease-out; 17 | box-shadow: -2rem 2rem 2rem rgba(0, 0, 0, 0.2); 18 | filter: blur(0); 19 | transform: scale(1); 20 | z-index: 1000; 21 | visibility: visible; 22 | } 23 | .modal .modal__content{ 24 | width: 75%; 25 | margin: 20% auto; 26 | overflow: auto; 27 | } 28 | .modal.off { 29 | opacity: 0; 30 | visibility: hidden; 31 | filter: blur(8px); 32 | transform: scale(0.33); 33 | box-shadow: 1rem 0 0 rgba(0, 0, 0, 0.2); 34 | } 35 | @supports (offset-rotation: 0deg) { 36 | .modal.off { 37 | offset-distance: 100%; 38 | } 39 | } 40 | @media (prefers-reduced-motion) { 41 | .modal { 42 | offset-path: none; 43 | } 44 | } 45 | .modal h4 { 46 | left: 50%; 47 | top: 50%; 48 | align-content: center; 49 | color: black; 50 | border-bottom: 1px solid #ccc; 51 | background-color: white; 52 | padding: 1rem; 53 | margin: 0; 54 | } 55 | .modal .content { 56 | left: 50%; 57 | top: 50%; 58 | padding: 1rem; 59 | color: black; 60 | border: 1px solid #ccc; 61 | background-color: white; 62 | justify-content: center; 63 | align-content: center; 64 | align-self: center; 65 | -webkit-overflow-scrolling: touch; 66 | } 67 | .modal .actions { 68 | border-top: 1px solid #ccc; 69 | background: #eee; 70 | padding: 0.5rem 1rem; 71 | } 72 | .modal .actions button { 73 | border: 0; 74 | background:color(orange,20); 75 | border-radius: 5px; 76 | padding: 0.5rem 1rem; 77 | font-size: 0.8rem; 78 | line-height: 1; 79 | } 80 | #centered-toggle-button { 81 | position: absolute; 82 | } -------------------------------------------------------------------------------- /source/app/components/DocumentList/DocumentList.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | // List 4 | .list { 5 | display: block; 6 | width: span(8); 7 | margin: 0 auto; 8 | 9 | a { 10 | display: flex; 11 | padding: em(16) em(36) em(15); 12 | color: $type-color-default; 13 | text-decoration: none; 14 | border-radius: inherit; 15 | cursor: pointer; 16 | align-items: center; 17 | 18 | &:hover { 19 | background-color: rgba(color(gray, 40), 0.2); 20 | } 21 | 22 | &:focus { 23 | color: color(orange, 40); 24 | background-color: color(gray, 90); 25 | outline: 0; 26 | 27 | svg { 28 | fill: color(orange, 40); 29 | } 30 | } 31 | } 32 | 33 | li { 34 | border-radius: em(8); 35 | background-color: color(gray, 80); 36 | 37 | &:nth-child(even) { 38 | background: color(gray, 70); 39 | } 40 | } 41 | 42 | svg { 43 | @include relative(-1px); 44 | vertical-align: middle; 45 | fill: color(gray, 30); 46 | } 47 | 48 | 49 | @include media-grid(4) { 50 | border-right: 0; 51 | border-left: 0; 52 | 53 | a { 54 | padding-right: $gutter-site-4col; 55 | padding-left: $gutter-site-4col; 56 | } 57 | } 58 | } 59 | 60 | 61 | .listHeader { 62 | display: flex; 63 | padding: em(6) em(36) em(5); 64 | background: color(gray, 90); 65 | border-radius: em(8); 66 | 67 | span { 68 | @include type-body-supplemental(); 69 | } 70 | 71 | @include media-grid(4) { 72 | padding-right: $gutter-site-4col; 73 | padding-left: $gutter-site-4col; 74 | } 75 | } 76 | 77 | .leftSpace { 78 | flex: 0 0 24px; 79 | margin-right: em(12); 80 | } 81 | 82 | .nameHeader { 83 | flex: 1 1 0px; 84 | margin-right: rem(10); 85 | } 86 | 87 | .typeHeader { 88 | flex: 0 0 rem(100); 89 | } 90 | 91 | .statusHeader { 92 | flex: 0 0 rem(100); 93 | } 94 | 95 | .rightSpace { 96 | flex: 0 0 24px; 97 | } 98 | -------------------------------------------------------------------------------- /source/app/components/DocumentListItem/DocumentListItem.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .icon { 4 | flex: 0 0 24px; 5 | margin-right: em(12); 6 | } 7 | 8 | .filename { 9 | flex: 1 1 0px; 10 | overflow: hidden; 11 | text-overflow: ellipsis; 12 | white-space: nowrap; 13 | margin-right: rem(10); 14 | } 15 | 16 | .extension { 17 | flex: 0 0 rem(100); 18 | } 19 | 20 | .processing { 21 | flex: 0 0 rem(100); 22 | color: color(orange, 20) 23 | } 24 | 25 | .ready { 26 | flex: 0 0 rem(100); 27 | color: color(teal, 10) 28 | } 29 | 30 | .failed { 31 | flex: 0 0 rem(100); 32 | color: color(red, 10) 33 | } 34 | 35 | .deleteSpacer { 36 | flex: 0 0 24px; 37 | } 38 | 39 | .deleteButton { 40 | width: 24px; 41 | height: 24px; 42 | flex: 0 0 24px; 43 | border: none; 44 | box-shadow: none; 45 | display: inline-block; 46 | background: url(/static/images/icon_delete_01.png); 47 | opacity: 0.6; 48 | cursor: pointer; 49 | 50 | &:hover, &:focus { 51 | opacity: 1; 52 | } 53 | } 54 | 55 | .failedFileRow{ 56 | 57 | background-color: #7c7f83; 58 | opacity: 0.5; 59 | 60 | &:hover, &:focus { 61 | background-color: #595f68; 62 | opacity: 0.5; 63 | 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /source/app/components/DocumentPreview/DocumentPreview.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .entityList { 5 | @include absolute(0, 0, 0, 0); 6 | padding: rem(10) rem(20); 7 | margin: 0; 8 | overflow: auto; 9 | transition: opacity 200ms ease; 10 | opacity: 0; 11 | pointer-events: none; 12 | 13 | > ul { 14 | margin: 0; 15 | padding: 0; 16 | list-style: none; 17 | } 18 | } 19 | 20 | .visible { 21 | opacity: 1; 22 | pointer-events: all; 23 | } 24 | 25 | .ev { 26 | padding: rem(10) 0; 27 | margin-bottom: rem(10); 28 | opacity: 0.4; 29 | position: relative; 30 | 31 | &.onThisPage { 32 | opacity: 1; 33 | } 34 | 35 | h5 { 36 | @include type-body-primary; 37 | margin: 0; 38 | } 39 | 40 | p { 41 | @include type-body-secondary; 42 | margin: 0; 43 | } 44 | } 45 | 46 | .actions { 47 | display: flex; 48 | flex-direction: row; 49 | justify-content: center; 50 | 51 | > * { 52 | margin: rem(10) 0; 53 | } 54 | } 55 | 56 | .noEntity { 57 | margin: rem(10); 58 | } 59 | 60 | .pageSeparator { 61 | font-size: .8em; 62 | text-transform: uppercase; 63 | padding-top: 1em; 64 | } 65 | 66 | .redactSpan { 67 | float:right; 68 | } 69 | 70 | .valueRedact { 71 | position: absolute; 72 | right: 0; 73 | top: rem(15); 74 | opacity: .8; 75 | cursor: pointer; 76 | background: color(gray, 80); 77 | color: color(orange, 20); 78 | padding: em(2) em(8); 79 | border-radius: rem(3); 80 | 81 | &:hover { 82 | opacity: 1; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /source/app/components/DocumentSearchBar/DocumentSearchBar.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .searchBar { 5 | display: flex; 6 | align-items: center; 7 | padding: em(10) 0; 8 | } 9 | 10 | .wrapper { 11 | position: relative; 12 | flex: 1; 13 | display: flex; 14 | } 15 | 16 | .search { 17 | display: block; 18 | flex: 1; 19 | } 20 | 21 | .clear { 22 | position: absolute; 23 | right: 0; 24 | z-index: 2; 25 | margin: 0; 26 | border: none; 27 | padding: 0; 28 | top: 3px; 29 | right: 8px; 30 | 31 | svg { 32 | margin: 0 !important; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /source/app/components/DocumentViewer/DocumentViewer.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .viewer { 4 | position: relative; 5 | display: flex; 6 | flex-direction: column; 7 | align-items: center; 8 | overflow-y: scroll; 9 | @include site-gutters; 10 | } 11 | 12 | .pdfViewer { 13 | overflow-y: hidden; 14 | align-items: stretch; 15 | } 16 | 17 | .document { 18 | flex: 1; 19 | display: flex; 20 | flex-direction: column; 21 | } 22 | 23 | .pager { 24 | flex: 1; 25 | display: flex; 26 | flex-direction: column; 27 | width: 66.11296vw; 28 | max-width: 90%; 29 | align-self: center; 30 | } 31 | 32 | .page { 33 | } 34 | 35 | .imageWrapper { 36 | flex: 1 1 0px; 37 | text-align: center; 38 | 39 | .canvas { 40 | width: 100%; 41 | display: inline-flex; 42 | } 43 | } 44 | 45 | .image { 46 | width: 100%; 47 | } 48 | 49 | .canvas { 50 | box-shadow: 0 2px 10px rgba(color(gray, 80), 0.1); 51 | position: relative; 52 | display: flex; 53 | flex: 1; 54 | font-size: 0; 55 | align-self: center; 56 | flex: column; 57 | justify-content: center; 58 | } 59 | 60 | .pdfViewer .canvasWrapper { 61 | flex: 1 1 0px; 62 | flex-direction: column; 63 | overflow: hidden; 64 | overflow-y: auto; 65 | align-items: center; 66 | } 67 | 68 | .highlight { 69 | position: absolute; 70 | display: block; 71 | background-color: rgba(#fee385, 0.5); 72 | box-shadow: 0 0 0 2px color(orange); 73 | box-sizing: content-box; 74 | transition: all 1000ms 1000ms linear; 75 | transition-property: background-color, box-shadow; 76 | 77 | @supports(mix-blend-mode: multiply) { 78 | background-color: #fee385; 79 | mix-blend-mode: multiply; 80 | } 81 | 82 | &:global(.key) { 83 | background-color: rgba(#16bf9f, 0.5); 84 | box-shadow: 0 0 0 2px #16bf9f; 85 | } 86 | 87 | &.highlighted { 88 | background-color: rgba(#0095ff, 0.5); 89 | box-shadow: 0 0 0 2px #0095ff; 90 | transition: none; 91 | } 92 | } 93 | 94 | .redact { 95 | position: absolute; 96 | display: block; 97 | background-color: #000; 98 | box-shadow: 0 0 0 2px #000; 99 | box-sizing: content-box; 100 | z-index: 4; 101 | } 102 | 103 | .cellHighlight { 104 | position: absolute; 105 | display: block; 106 | background: transparent; 107 | box-shadow: 0 0 0 0.5px color(orange); 108 | pointer-events: none; 109 | } 110 | -------------------------------------------------------------------------------- /source/app/components/EntitiesCheckbox/EntitiesCheckbox.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .entityList { 5 | @include absolute(0, 0, 0, 0); 6 | padding: rem(10) rem(20); 7 | margin: 0; 8 | overflow: auto; 9 | transition: opacity 200ms ease; 10 | opacity: 0; 11 | pointer-events: none; 12 | 13 | > ul { 14 | margin: 0; 15 | padding: 0; 16 | list-style: none; 17 | } 18 | } 19 | 20 | .visible { 21 | opacity: 1; 22 | pointer-events: all; 23 | } 24 | 25 | .ev { 26 | padding: rem(10) 0; 27 | margin-bottom: rem(10); 28 | opacity: 0.4; 29 | position: relative; 30 | 31 | &.onThisPage { 32 | opacity: 1; 33 | } 34 | 35 | h5 { 36 | @include type-body-primary; 37 | margin: 0; 38 | } 39 | 40 | p { 41 | @include type-body-secondary; 42 | margin: 0; 43 | } 44 | } 45 | 46 | .actions { 47 | display: flex; 48 | flex-direction: row; 49 | justify-content: center; 50 | 51 | > * { 52 | margin: rem(10) 0; 53 | } 54 | } 55 | 56 | .noEntity { 57 | margin: rem(10); 58 | } 59 | 60 | .pageSeparator { 61 | font-size: .8em; 62 | text-transform: uppercase; 63 | padding-top: 1em; 64 | } 65 | 66 | .redactSpan { 67 | float:right; 68 | } 69 | 70 | .valueRedact { 71 | position: absolute; 72 | right: 0; 73 | top: rem(15); 74 | opacity: .8; 75 | cursor: pointer; 76 | background: color(gray, 80); 77 | color: color(orange, 20); 78 | padding: em(2) em(8); 79 | border-radius: rem(3); 80 | 81 | &:hover { 82 | opacity: 1; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /source/app/components/FeatureTooltip/FeatureTooltip.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | // Tooltip wrapper 4 | .tooltip { 5 | position: relative; 6 | display: inline-block; 7 | font-size: 0; 8 | 9 | // Trigger 10 | > img { 11 | width: rem(32); 12 | height: rem(32); 13 | cursor: pointer; 14 | } 15 | } 16 | 17 | // Tooltip overlay 18 | .overlay { 19 | @include absolute(0, null, null, 100%); 20 | @include type-body-primary(); 21 | width: rem(400); 22 | margin-left: rem(16); 23 | overflow: hidden; 24 | background-color: color(white); 25 | border-radius: rem(5); 26 | box-shadow: 2px 2px 20px rgba(color(black), 0.25); 27 | 28 | header { 29 | display: flex; 30 | padding: rem(8) rem(12) rem(8) rem(16); 31 | background-color: color(gray, 70); 32 | align-items: center; 33 | justify-content: space-between; 34 | } 35 | 36 | // Title 37 | h4 { 38 | @include type-heading-h5(color(gray, 30)); 39 | margin: 0; 40 | } 41 | 42 | // Description 43 | p { 44 | padding: 0 rem(16); 45 | } 46 | 47 | // Close button 48 | svg { 49 | cursor: pointer; 50 | 51 | &:hover g { 52 | stroke: color(orange, 20); 53 | } 54 | } 55 | 56 | @include media-grid(4) { 57 | top: 100%; 58 | left: 0; 59 | width: 90vw; 60 | max-width: rem(400); 61 | margin-top: rem(16); 62 | margin-left: 0; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /source/app/components/FileUpload/FileUpload.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | // File Upload Container 4 | .fileUpload { 5 | width: span(6); 6 | padding: rem(32); 7 | margin: 0 auto; 8 | text-align: center; 9 | background-color: color(gray, 80); 10 | border: 1px dashed color(gray, 60); 11 | border-radius: rem(5); 12 | user-select: none; 13 | 14 | // File upload icon 15 | > img { 16 | height: rem(80); 17 | } 18 | 19 | // Click to upload CTA 20 | em { 21 | font-style: normal; 22 | color: color(orange, 20); 23 | cursor: pointer; 24 | 25 | &:hover, 26 | &:focus { 27 | text-decoration: underline; 28 | outline: 0; 29 | } 30 | } 31 | 32 | // File list 33 | ul { 34 | padding: 0; 35 | margin: 2em 0; 36 | color: color(gray, 20); 37 | text-align: left; 38 | list-style-type: none; 39 | 40 | &:last-child { 41 | margin-bottom: 0; 42 | } 43 | } 44 | 45 | // File item 46 | li { 47 | position: relative; 48 | padding-right: rem(32); 49 | padding-left: 3rem; 50 | overflow: hidden; 51 | text-overflow: ellipsis; 52 | white-space: nowrap; 53 | 54 | // Success/error icons + progress percentage 55 | img, 56 | span { 57 | display: inline-block; 58 | width: 1.5rem; 59 | height: 1.5rem; 60 | margin-right: 0.5rem; 61 | margin-left: -3rem; 62 | vertical-align: middle; 63 | } 64 | 65 | // Progress percentage overrides 66 | span { 67 | @include type-body-supplemental(color(teal, 10)); 68 | display: inline-flex; 69 | align-items: center; 70 | } 71 | 72 | // Delete icon 73 | svg { 74 | @include absolute(50%, 0); 75 | cursor: pointer; 76 | transform: translateY(-50%); 77 | fill: color(gray, 40); 78 | 79 | &:hover { 80 | fill: color(red); 81 | } 82 | } 83 | } 84 | 85 | // Focus styles 86 | &:focus { 87 | outline: 0; 88 | } 89 | 90 | @include media-grid(8) { 91 | width: span(6, $grid-8col); 92 | } 93 | 94 | @include media-grid(4) { 95 | width: 100%; 96 | } 97 | } 98 | 99 | // Instructions 100 | .instructions { 101 | @include type-heading-h5(); 102 | margin-top: 2em; 103 | } 104 | 105 | // Limits 106 | .limits { 107 | @include type-body-supplemental(color(gray, 60)); 108 | margin-top: em(32, 12); 109 | margin-bottom: 0; 110 | } 111 | 112 | // Drag hover 113 | .dragActive { 114 | border-color: color(orange, 20); 115 | border-style: solid; 116 | 117 | .limits { 118 | color: color(orange, 20); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /source/app/components/Highlight/Highlight.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import React from 'react' 16 | import classNames from 'classnames' 17 | import PropTypes from 'prop-types' 18 | import Highlighter from 'react-highlighter' 19 | 20 | import css from './Highlight.module.scss' 21 | 22 | Highlight.propTypes = { 23 | children: PropTypes.node, 24 | className: PropTypes.string, 25 | } 26 | 27 | Highlight.defaultProps = {} 28 | 29 | export default function Highlight({ children, className, ...rest }) { 30 | const matchClassNames = classNames(css.match, className) 31 | 32 | return ( 33 | 34 | {children} 35 | 36 | ) 37 | } 38 | -------------------------------------------------------------------------------- /source/app/components/Highlight/Highlight.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | // Highlight mark wrapper 4 | .match { 5 | font-weight: 500; 6 | background-color: color(orange, 30); 7 | color: #fff; 8 | margin: -1px -2px; 9 | padding: 1px 2px; 10 | border-radius: 3px; 11 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); 12 | } 13 | -------------------------------------------------------------------------------- /source/app/components/KendraDocumentResults/KendraDocumentResults.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React, { Fragment, useMemo } from "react"; 15 | 16 | import KendraResultTitle from "../KendraResultTitle/KendraResultTitle"; 17 | import KendraHighlightedText from "../KendraHighlightedText/KendraHighlightedText"; 18 | import KendraResultFooter from "../KendraResultFooter/KendraResultFooter"; 19 | 20 | import styles from "./KendraDocumentResults.module.scss"; 21 | 22 | export default function KendraDocumentResults({ results, submitFeedback }) { 23 | const renderedResults = useMemo( 24 | () => 25 | results.map((result) => { 26 | return ( 27 |
28 | 32 |

33 | 36 |

37 | 41 |
42 | ); 43 | }), 44 | [results, submitFeedback] 45 | ); 46 | 47 | return
{renderedResults}
; 48 | } 49 | -------------------------------------------------------------------------------- /source/app/components/KendraDocumentResults/KendraDocumentResults.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .result { 4 | padding: 1.5em; 5 | 6 | p { 7 | @include type-body-secondary(color(gray, 20)); 8 | margin: .25em 0 0; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /source/app/components/KendraFAQItem/KendraFAQItem.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .item { 4 | border-top: 1px solid color(gray, 60); 5 | padding: 1em 1.5em; 6 | } 7 | 8 | .question { 9 | cursor: pointer; 10 | display: flex; 11 | 12 | a { 13 | text-decoration: none; 14 | } 15 | 16 | h3 { 17 | color: $link-blue; 18 | font-size: 1.25em; 19 | margin: 0; 20 | padding-bottom: 0; 21 | flex: 1 1 0px; 22 | overflow: hidden; 23 | text-overflow: ellipsis; 24 | white-space: nowrap; 25 | } 26 | 27 | &:after { 28 | content: '▶\fe0e'; 29 | flex: 0 0 auto; 30 | margin-left: 1em; 31 | } 32 | 33 | &.expanded:after { 34 | content: '▼' 35 | } 36 | } 37 | 38 | .answer { 39 | 40 | p { 41 | @include type-body-secondary(color(gray, 20)); 42 | margin: .25em 0 0; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /source/app/components/KendraFAQs/KendraFAQs.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React from "react"; 15 | import KendraFAQItem from "../KendraFAQItem/KendraFAQItem"; 16 | import TooltipButton from "../TooltipButton/TooltipButton"; 17 | 18 | import css from "./KendraFAQs.module.scss"; 19 | 20 | export default function KendraFAQs({ results, submitFeedback }) { 21 | if (!results.length) return null; 22 | 23 | return ( 24 |
25 |
26 |

27 | Frequently asked questions 28 | 31 |

Frequently asked questions

32 |

33 | You can upload a list of FAQs to Kendra to provide direct 34 | answers to common questions your end users are asking. Kendra 35 | will find the closest question to the search query and return 36 | the corresponding answer. 37 |

38 | 39 | } 40 | > 41 | 42 | 43 | More info 44 | 45 |
46 |

47 |
48 | {results.map((item) => ( 49 | 54 | ))} 55 |
56 | ); 57 | } 58 | -------------------------------------------------------------------------------- /source/app/components/KendraFAQs/KendraFAQs.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .faqs { 4 | border: 1px solid color(gray, 60); 5 | background: color(gray, 70); 6 | border-radius: 1em; 7 | margin-top: 2em; 8 | 9 | > header { 10 | padding: 1em 1.5em; 11 | } 12 | 13 | h2 { 14 | font-size: 1em; 15 | color: color(gray, 60); 16 | margin: 0; 17 | padding: 0; 18 | } 19 | 20 | > header a { 21 | color: $link-blue; 22 | margin-left: 1em; 23 | font-style: italic; 24 | font-weight: normal; 25 | 26 | img { 27 | position: relative; 28 | top: .2em; 29 | margin-right: .5em; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /source/app/components/KendraHighlightedText/KendraHighlightedText.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .base { 4 | mark { 5 | font-weight: 500; 6 | background-color: color(orange, 30); 7 | color: #fff; 8 | margin: -1px -2px; 9 | padding: 1px 2px; 10 | border-radius: 3px; 11 | box-shadow: 0 1px 1px rgba(0, 0, 0, 0.3); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /source/app/components/KendraResultFeedback/KendraResultFeedback.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .button { 4 | border: none; 5 | padding: 0; 6 | margin: 0; 7 | box-shadow: none; 8 | width: 35px; 9 | height: 35px; 10 | position: relative; 11 | border-radius: 50%; 12 | border: 1.2px solid currentColor; 13 | background: none; 14 | color: #fff; 15 | cursor: pointer; 16 | opacity: 0.2; 17 | margin-left: 10px; 18 | 19 | svg { 20 | height: 100%; 21 | width: 100%; 22 | } 23 | 24 | path { 25 | fill: currentColor; 26 | } 27 | 28 | &:hover { 29 | opacity: .6; 30 | } 31 | 32 | &:disabled { 33 | opacity: 0.2; 34 | } 35 | 36 | &.selected { 37 | opacity: 1; 38 | background: $link-blue; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /source/app/components/KendraResultFooter/KendraResultFooter.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React from "react"; 15 | 16 | import KendraResultFeedback from "../KendraResultFeedback/KendraResultFeedback"; 17 | import styles from "./KendraResultFooter.module.scss"; 18 | 19 | export default function KendraResultFooter({ result, submitFeedback }) { 20 | return ( 21 | 25 | ); 26 | } 27 | -------------------------------------------------------------------------------- /source/app/components/KendraResultFooter/KendraResultFooter.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .footer { 4 | display: flex; 5 | justify-content: flex-end; 6 | } 7 | -------------------------------------------------------------------------------- /source/app/components/KendraResultPage/KendraResultPage.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .resultList { 4 | display: flex; 5 | flex-direction: column; 6 | 7 | > h3 { 8 | text-align: center; 9 | } 10 | } 11 | 12 | .searchSummary { 13 | @include type-body-supplemental(color(orange, 20)); 14 | @include all-caps; 15 | margin: 0.5rem 0; 16 | font-weight: 500; 17 | line-height: 2; 18 | } 19 | -------------------------------------------------------------------------------- /source/app/components/KendraResultTitle/KendraResultTitle.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React, { useCallback } from "react"; 15 | 16 | import LinkWithClickHandler from "../LinkWithClickHandler/LinkWithClickHandler"; 17 | 18 | import KendraHighlightedText from "../KendraHighlightedText/KendraHighlightedText"; 19 | 20 | import styles from "./KendraResultTitle.module.scss"; 21 | import { makeDocumentLink } from "../../utils/link-generators"; 22 | 23 | export default function KendraResultTitle({ result, submitFeedback }) { 24 | let resultTitle; 25 | 26 | if (result.DocumentTitle && result.DocumentTitle.Text) { 27 | const truncatedTitle = { 28 | ...result.DocumentTitle, 29 | Text: result.DocumentTitle.Text.replace(/-searchable$/, ''), 30 | } 31 | resultTitle = ( 32 | 33 | ); 34 | } else if (result.DocumentURI) { 35 | resultTitle = result.DocumentURI; 36 | } 37 | 38 | const handleClick = useCallback(() => { 39 | submitFeedback("CLICK", result); 40 | }, [submitFeedback, result]); 41 | 42 | if (!resultTitle) return null; 43 | 44 | const uri = result.DocumentURI; 45 | 46 | // TODO link to doc 47 | 48 | return ( 49 |
50 | 54 |

{resultTitle}

55 |
56 |
57 | ); 58 | } 59 | -------------------------------------------------------------------------------- /source/app/components/KendraResultTitle/KendraResultTitle.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .title { 4 | font-size: 1.25em; 5 | margin: 0; 6 | padding-bottom: .25em; 7 | } 8 | 9 | .header { 10 | a { 11 | text-decoration: none; 12 | } 13 | 14 | h3 { 15 | color: $link-blue; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /source/app/components/KendraResults/KendraResults.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .base { 4 | width: rem(800); 5 | } 6 | 7 | .doubleWidth { 8 | width: rem(1600); 9 | } 10 | 11 | .resultContainer { 12 | display: flex; 13 | flex-direction: row; 14 | justify-content: center; 15 | 16 | > * { 17 | flex: 0 1 rem(800); 18 | overflow: hidden; 19 | } 20 | 21 | > * + * { 22 | margin-left: rem(40); 23 | } 24 | } 25 | 26 | .topNav { 27 | display: flex; 28 | justify-content: space-between; 29 | align-items: center; 30 | 31 | > header { 32 | &.comparing { 33 | width: 100%; 34 | text-align: center; 35 | 36 | h2 { 37 | margin-bottom: 0; 38 | } 39 | 40 | p { 41 | margin-top: 0; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /source/app/components/KendraTopResults/KendraTopResults.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .topResults { 4 | border: 1px solid color(gray, 60); 5 | background: color(gray, 70); 6 | border-radius: 1em; 7 | 8 | > header { 9 | padding: 1em 1.5em; 10 | border-bottom: inherit; 11 | } 12 | 13 | h2 { 14 | font-size: 1em; 15 | color: color(gray, 60); 16 | margin: 0; 17 | padding: 0; 18 | } 19 | 20 | > header a { 21 | color: $link-blue; 22 | margin-left: 1em; 23 | font-style: italic; 24 | font-weight: normal; 25 | 26 | img { 27 | position: relative; 28 | top: .2em; 29 | margin-right: .5em; 30 | } 31 | } 32 | } 33 | 34 | .results { 35 | padding: 1em; 36 | padding-top: 0; 37 | } 38 | 39 | .result { 40 | padding: 1em 0.5em; 41 | 42 | p { 43 | @include type-body-secondary(color(gray, 20)); 44 | margin: .25em 0 0; 45 | line-clamp: 5; 46 | 47 | display: -webkit-box; 48 | -webkit-box-orient: vertical; 49 | -webkit-line-clamp: 5; 50 | overflow: hidden; 51 | } 52 | } 53 | 54 | .showMore { 55 | cursor: pointer; 56 | 57 | &:before { 58 | content: '▶\fe0e'; 59 | margin-right: 1em;; 60 | } 61 | 62 | &.expanded:before { 63 | content: '▼' 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /source/app/components/KeyValueList/KeyValueList.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .kvList { 5 | @include absolute(0, 0, 0, 0); 6 | padding: rem(10) rem(20); 7 | margin: 0; 8 | overflow: auto; 9 | transition: opacity 200ms ease; 10 | opacity: 0; 11 | pointer-events: none; 12 | 13 | > ul { 14 | margin: 0; 15 | padding: 0; 16 | list-style: none; 17 | } 18 | } 19 | 20 | .visible { 21 | opacity: 1; 22 | pointer-events: all; 23 | } 24 | 25 | .kv { 26 | padding: rem(10) 0; 27 | margin-bottom: rem(10); 28 | opacity: 0.4; 29 | position: relative; 30 | 31 | &.onThisPage { 32 | opacity: 1; 33 | } 34 | 35 | &.hasRedact { 36 | padding-right: rem(75); 37 | } 38 | 39 | h5 { 40 | @include type-body-primary; 41 | margin: 0; 42 | } 43 | 44 | p { 45 | @include type-body-secondary; 46 | margin: 0; 47 | } 48 | } 49 | 50 | .actions { 51 | display: flex; 52 | flex-direction: row; 53 | justify-content: center; 54 | 55 | > * { 56 | margin: rem(10) 0; 57 | } 58 | } 59 | 60 | .noKv { 61 | margin: rem(10); 62 | } 63 | 64 | .pageSeparator { 65 | font-size: .8em; 66 | text-transform: uppercase; 67 | padding-top: 1em; 68 | } 69 | 70 | 71 | .valueRedact { 72 | position: absolute; 73 | right: 0; 74 | top: rem(15); 75 | opacity: .8; 76 | cursor: pointer; 77 | background: color(gray, 80); 78 | color: color(orange, 20); 79 | padding: em(2) em(8); 80 | border-radius: rem(3); 81 | 82 | &:hover { 83 | opacity: 1; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /source/app/components/LinkWithClickHandler/LinkWithClickHandler.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React, { forwardRef, useCallback } from "react"; 15 | import Link from "next/link"; 16 | 17 | const WrappedLink = forwardRef(function WrappedLink( 18 | { customClick, onClick, children, ...rest }, 19 | ref 20 | ) { 21 | const handleClick = useCallback( 22 | (e) => { 23 | customClick(e); 24 | onClick(e); 25 | }, 26 | [customClick, onClick] 27 | ); 28 | 29 | return React.cloneElement(React.Children.only(children), { 30 | ref, 31 | onClick: handleClick, 32 | ...rest 33 | }); 34 | }); 35 | 36 | export default function LinkWithClickHandler({ onClick, children, ...rest }) { 37 | return ( 38 | 39 | {children} 40 | 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /source/app/components/Loading/Loading.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .loading { 4 | display: inline-block; 5 | } 6 | 7 | .overlay { 8 | @include absolute(0, 0, 0, 0); 9 | display: flex; 10 | background-color: rgba(color(gray, 80), 0.7); 11 | align-items: center; 12 | justify-content: center; 13 | } 14 | -------------------------------------------------------------------------------- /source/app/components/Modal/Modal.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React, { useCallback } from "react"; 15 | import ReactDOM from "react-dom"; 16 | 17 | import css from "./Modal.module.scss"; 18 | 19 | export default function Modal({ title, children, onRequestClose }) { 20 | const stopProp = useCallback((e) => { 21 | e.stopPropagation(); 22 | }, []); 23 | 24 | return ReactDOM.createPortal( 25 |
26 |
27 |
28 |

{title}

29 | 30 | 31 | 32 | 33 | 34 |
35 |
{children}
36 |
37 |
, 38 | document.body 39 | ); 40 | } 41 | -------------------------------------------------------------------------------- /source/app/components/Modal/Modal.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .container { 4 | position: fixed; 5 | top: 0; 6 | left: 0; 7 | right: 0; 8 | bottom: 0; 9 | background: rgba(color(gray, 90), 0.8); 10 | display: flex; 11 | flex-direction: column; 12 | align-items: center; 13 | z-index: 100000; 14 | 15 | &:before, &:after { 16 | flex: 1; 17 | content: ''; 18 | } 19 | } 20 | 21 | .modal { 22 | flex: 0 0 auto; 23 | background: #fff; 24 | box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 1px rgba(0, 0, 0, 0.2); 25 | color: #000; 26 | width: 800px; 27 | max-width: 90vw; 28 | max-height: 90vh; 29 | overflow: auto; 30 | 31 | > header { 32 | padding: 1em 1.5em; 33 | background-color: color(gray, 20); 34 | border-bottom: 1px solid color(gray, 30); 35 | position: relative; 36 | 37 | h2 { 38 | color: #000; 39 | font-size: 1.5em; 40 | margin: 0; 41 | padding: 0; 42 | } 43 | 44 | .closeButton { 45 | position: absolute; 46 | right: 1.4em; 47 | top: 1.4em; 48 | cursor: pointer; 49 | } 50 | 51 | path { 52 | stroke: #000; 53 | fill: none; 54 | stroke-width: 2px; 55 | } 56 | } 57 | } 58 | 59 | .content { 60 | padding: 1.5em; 61 | } 62 | -------------------------------------------------------------------------------- /source/app/components/ModalContext/ModalContext.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { createContext } from 'react'; 16 | 17 | const ModalContext = createContext(); 18 | 19 | export default ModalContext; -------------------------------------------------------------------------------- /source/app/components/Pager/Pager.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .pager { 4 | } 5 | 6 | .header { 7 | @include type-heading-h3; 8 | display: flex; 9 | margin-bottom: .5rem; 10 | user-select: none; 11 | align-items: flex-start; 12 | flex-wrap: wrap; 13 | 14 | 15 | .disabled { 16 | cursor: default; 17 | 18 | g { 19 | stroke: color(gray, 50); 20 | } 21 | 22 | &:focus g, 23 | &:hover g { 24 | stroke: color(gray, 50); 25 | } 26 | } 27 | } 28 | 29 | .footer { 30 | @include type-heading-h5; 31 | display: flex; 32 | margin: 1rem 0; 33 | user-select: none; 34 | align-items: center; 35 | justify-content: center; 36 | flex-wrap: wrap; 37 | 38 | svg { 39 | display: inline-block; 40 | margin: 0 1rem; 41 | cursor: pointer; 42 | outline: 0; 43 | 44 | &:focus g, 45 | &:hover g { 46 | stroke: color(orange); 47 | } 48 | } 49 | } 50 | 51 | .subtitle { 52 | @include type-body-secondary(color(gray, 60)); 53 | @include all-caps; 54 | width: 100%; 55 | margin: 0.5rem 0 0 0.25rem; 56 | font-weight: 500; 57 | } 58 | -------------------------------------------------------------------------------- /source/app/components/PersonaInfoModal/PersonaInfoModal.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .actions { 4 | text-align: right; 5 | } 6 | 7 | .personas { 8 | display: flex; 9 | flex-direction: row; 10 | flex-wrap: wrap; 11 | margin: 0 1em; 12 | 13 | > * { 14 | display: flex; 15 | flex-direction: column; 16 | flex: 1 1 0px; 17 | min-width: 100px; 18 | max-width: 200px; 19 | margin: 0 1em; 20 | overflow: hidden; 21 | align-items: center; 22 | font-size: 0.8em; 23 | text-align: center; 24 | cursor: pointer; 25 | } 26 | 27 | img { 28 | max-width: 100px; 29 | margin-bottom: .5em; 30 | } 31 | 32 | h4 { 33 | @include type-heading-h5(inherit); 34 | margin-bottom: 0; 35 | } 36 | 37 | p { 38 | margin: 0; 39 | } 40 | } 41 | 42 | .notes { 43 | font-style: italic; 44 | margin-top: 1em; 45 | } 46 | 47 | .stepLabel { 48 | float: left; 49 | margin-right: 1em; 50 | font-size: 1.25em; 51 | font-weight: bold; 52 | } 53 | 54 | .sampleQueries { 55 | list-style-type: none; 56 | 57 | li { 58 | cursor: pointer; 59 | color: color(blue, 20) 60 | } 61 | } 62 | 63 | .toggleAPI { 64 | margin: 1em -1.5em -1.5em; 65 | padding: 1.5em; 66 | color: $link-blue; 67 | cursor: pointer; 68 | font-weight: bold; 69 | border-top: 1px solid color(gray, 40); 70 | 71 | &:before { 72 | content: '▶\fe0e'; 73 | margin-right: 1em; 74 | } 75 | 76 | &.expanded:before { 77 | content: '▼' 78 | } 79 | } 80 | 81 | .learnMore { 82 | a { 83 | color: $link-blue; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /source/app/components/PersonaLabel/PersonaLabel.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .wrapper { 4 | display: inline-block; 5 | color: #fff; 6 | position: relative; 7 | } 8 | 9 | .personaLabel { 10 | 11 | padding: .25em .5em; 12 | border-radius: .25em; 13 | background: $link-blue; 14 | line-height: 1.3; 15 | cursor: pointer; 16 | 17 | &:after { 18 | content: '▼'; 19 | margin-left: .5em; 20 | } 21 | } 22 | 23 | .removePersona { 24 | @include type-body-primary(); 25 | cursor: pointer; 26 | color: $link-blue; 27 | text-transform: none; 28 | letter-spacing: normal; 29 | position: relative; 30 | top: 2px; 31 | margin-left: 1em; 32 | font-style: italic; 33 | } 34 | 35 | .menu { 36 | position: absolute;; 37 | top: 0; 38 | left: 0; 39 | z-index: 300; 40 | background: $link-blue; 41 | border-radius: .25em; 42 | white-space: nowrap; 43 | min-width: 100%; 44 | 45 | a { 46 | cursor: pointer; 47 | padding: 0 .5em; 48 | display: block; 49 | 50 | &:hover { 51 | background: rgba(0, 0, 0, 0.2); 52 | } 53 | } 54 | } 55 | 56 | .overlay { 57 | position: fixed; 58 | top: 0; 59 | left: 0; 60 | right: 0; 61 | bottom: 0; 62 | z-index: 100; 63 | } 64 | -------------------------------------------------------------------------------- /source/app/components/PersonaSelector/PersonaSelector.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .container { 4 | position: relative; 5 | text-align: right; 6 | z-index: 4; 7 | } 8 | 9 | 10 | .overlay { 11 | position: fixed; 12 | top: 0; 13 | left: 0; 14 | right: 0; 15 | bottom: 0; 16 | background: rgba(color(gray, 90), 0.8); 17 | z-index: 3; 18 | } 19 | 20 | .filterButton { 21 | margin-top: 1.6em; 22 | padding: .25em 1em; 23 | padding-right: .75em; 24 | border: 1px solid #fff; 25 | cursor: pointer; 26 | display: inline-block; 27 | border-radius: .25em; 28 | 29 | &.hasFilter { 30 | border-color: $link-blue; 31 | } 32 | 33 | &:after { 34 | content: '▼'; 35 | margin-left: 1ch; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /source/app/components/RawTextLines/RawTextLines.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .lineList { 5 | @include absolute(0, 0, 0, 0); 6 | padding: rem(10) rem(20); 7 | margin: 0; 8 | overflow: auto; 9 | transition: opacity 200ms ease; 10 | opacity: 0; 11 | pointer-events: none; 12 | 13 | > ul { 14 | margin: 0; 15 | padding: 0; 16 | list-style: none; 17 | } 18 | } 19 | 20 | .visible { 21 | opacity: 1; 22 | pointer-events: all; 23 | } 24 | 25 | .line { 26 | padding-bottom: rem(10); 27 | opacity: 0.4; 28 | position: relative; 29 | 30 | &.onThisPage { 31 | opacity: 1; 32 | } 33 | } 34 | 35 | .actions { 36 | display: flex; 37 | flex-direction: row; 38 | justify-content: center; 39 | 40 | > * { 41 | margin: rem(10) 0; 42 | } 43 | } 44 | 45 | .empty { 46 | margin: rem(10); 47 | } 48 | 49 | .pageSeparator { 50 | font-size: .8em; 51 | text-transform: uppercase; 52 | padding-top: 2em; 53 | } 54 | 55 | 56 | .valueRedact { 57 | position: absolute; 58 | right: 0; 59 | top: rem(15); 60 | opacity: .8; 61 | cursor: pointer; 62 | background: color(gray, 80); 63 | color: color(orange, 20); 64 | padding: em(2) em(8); 65 | border-radius: rem(3); 66 | 67 | &:hover { 68 | opacity: 1; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /source/app/components/SampleCollections/SampleCollections.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .list { 4 | display: flex; 5 | flex-flow: row wrap; 6 | width: span(6); 7 | padding: 0; 8 | margin: 0 auto; 9 | justify-content: center; 10 | justify-items: center; 11 | 12 | @include media-grid(8) { 13 | width: span(6, $grid-8col); 14 | } 15 | 16 | @include media-grid(4) { 17 | width: 100%; 18 | } 19 | } 20 | 21 | .item { 22 | display: flex; 23 | flex-direction: column; 24 | align-items: center; 25 | margin: rem(20); 26 | width: rem(150); 27 | text-align: center; 28 | } 29 | 30 | .doc { 31 | width: em(100); 32 | height: em(150); 33 | margin-bottom: rem(15); 34 | background: #fff; 35 | display: flex; 36 | box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2), 0 0 1px rgba(0, 0, 0, 0.3); 37 | 38 | img { 39 | width: 100%; 40 | } 41 | } 42 | 43 | .docPile { 44 | width: em(100); 45 | height: em(150); 46 | position: relative; 47 | margin-bottom: rem(15); 48 | 49 | > * { 50 | transform-origin: 50% 80%; 51 | position: absolute; 52 | z-index: 2; 53 | margin-bottom: 0; 54 | } 55 | 56 | > :first-child { 57 | transform: rotate(10deg); 58 | z-index: 3; 59 | } 60 | 61 | > :last-child { 62 | transform: rotate(-10deg); 63 | z-index: 1; 64 | } 65 | } 66 | 67 | .spinnerButton { 68 | position: relative; 69 | 70 | span { 71 | left: 0; 72 | position: absolute; 73 | display: inline-block; 74 | width: 2em; 75 | height: 2em; 76 | vertical-align: middle; 77 | margin-top: -4px; 78 | opacity: 0; 79 | } 80 | 81 | &.pending { 82 | transition: padding-left 200ms ease; 83 | padding-left: 2em; 84 | 85 | span { 86 | transition: opacity 200ms linear; 87 | opacity: 1; 88 | } 89 | } 90 | } 91 | 92 | .previewDoc { 93 | @include fixed(0, 0, 0, 0); 94 | z-index: 20; 95 | background: rgba(0, 0, 0, 0.8); 96 | 97 | @supports (backdrop-filter: blur(5px)) { 98 | background: rgba(0, 0, 0, 0.7); 99 | backdrop-filter: blur(5px); 100 | } 101 | 102 | display: flex; 103 | flex-direction: row; 104 | padding: 5vh; 105 | align-items: center; 106 | justify-content: center; 107 | 108 | img { 109 | height: 100%; 110 | } 111 | } 112 | 113 | .details { 114 | margin-left: rem(30); 115 | } 116 | -------------------------------------------------------------------------------- /source/app/components/SearchBar/SearchBar.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .searchBar { 5 | display: flex; 6 | align-items: center; 7 | padding: em(10) 0; 8 | } 9 | 10 | .wrapper { 11 | position: relative; 12 | flex: 1; 13 | display: flex; 14 | } 15 | 16 | .search { 17 | display: block; 18 | flex: 1; 19 | } 20 | 21 | .clear { 22 | position: absolute; 23 | right: 0; 24 | z-index: 2; 25 | margin: 0; 26 | border: none; 27 | padding: 0; 28 | top: 3px; 29 | right: 8px; 30 | 31 | svg { 32 | margin: 0 !important; 33 | } 34 | } 35 | 36 | .suggestions { 37 | position: absolute; 38 | top: 100%; 39 | left: 0; 40 | right: 0; 41 | z-index: 1000; 42 | margin-top: 3px; 43 | background: color(gray, 80); 44 | border: 1px solid color(gray, 60); 45 | display: none; 46 | border-radius: 1em; 47 | box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2); 48 | 49 | ul { 50 | list-style-type: none; 51 | padding: 0; 52 | margin: 0; 53 | border-radius: inherit; 54 | } 55 | 56 | li { 57 | padding: 1em; 58 | cursor: pointer; 59 | 60 | &:hover { 61 | background: color(gray, 90); 62 | } 63 | 64 | &:first-child { 65 | border-top-left-radius: inherit; 66 | border-top-right-radius: inherit; 67 | } 68 | 69 | &:last-child { 70 | border-bottom-left-radius: inherit; 71 | border-bottom-right-radius: inherit; 72 | } 73 | } 74 | } 75 | 76 | .wrapper:focus-within, 77 | .wrapper:active { 78 | .suggestions { 79 | display: block; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /source/app/components/SearchResults/SearchResults.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .searchResults { 4 | position: relative; 5 | width: rem(800); 6 | min-height: 300px; 7 | 8 | > header { 9 | &.comparing { 10 | text-align: center; 11 | 12 | h2 { 13 | margin-bottom: 0; 14 | } 15 | 16 | p { 17 | margin-top: 0; 18 | } 19 | } 20 | } 21 | 22 | svg { 23 | display: inline-block; 24 | margin-top: rem(-2); 25 | margin-right: 0.5rem; 26 | fill: color(gray, 30); 27 | } 28 | 29 | a { 30 | display: block; 31 | padding: 1rem; 32 | margin-bottom: 1rem; 33 | text-decoration: none; 34 | border-radius: inherit; 35 | 36 | &:hover, 37 | &:focus { 38 | outline: 0; 39 | } 40 | 41 | 42 | &:hover { 43 | background-color: rgba(color(gray, 40), 0.2); 44 | } 45 | 46 | &:focus { 47 | color: color(orange, 40); 48 | background-color: color(gray, 90); 49 | outline: 0; 50 | 51 | svg { 52 | fill: color(orange, 40); 53 | } 54 | } 55 | } 56 | 57 | @include media-grid(8) { 58 | width: 100%; 59 | } 60 | 61 | @include media-grid(4) { 62 | header { 63 | margin-bottom: 0.5em; 64 | flex-wrap: wrap; 65 | } 66 | 67 | svg { 68 | transform: translateY(rem(4)); 69 | } 70 | } 71 | } 72 | 73 | 74 | .resultItem { 75 | border-radius: em(8); 76 | background-color: color(gray, 80); 77 | 78 | &:nth-child(even) { 79 | background: color(gray, 70); 80 | } 81 | 82 | header { 83 | display: flex; 84 | margin-bottom: 0.25em; 85 | align-items: center; 86 | } 87 | 88 | h3 { 89 | font-size: 1.25em; 90 | margin: 0; 91 | padding-bottom: .25em; 92 | color: $link-blue; 93 | } 94 | } 95 | 96 | 97 | .count { 98 | @include type-body-supplemental(color(gray, 20)); 99 | @include all-caps; 100 | margin: rem(2) 0 0 auto; 101 | 102 | @include media-grid(4) { 103 | width: 100%; 104 | margin: 0 0 0 rem(32); 105 | } 106 | } 107 | 108 | .lines { 109 | @include type-body-secondary(color(gray, 20)); 110 | 111 | li { 112 | margin-bottom: 0.25rem; 113 | white-space: nowrap; 114 | text-overflow: ellipsis; 115 | overflow: hidden; 116 | 117 | &:last-child { 118 | margin-bottom: 0; 119 | } 120 | } 121 | 122 | 123 | @include media-grid(4) { 124 | margin-left: 0; 125 | 126 | li { 127 | margin-bottom: 0.5rem; 128 | } 129 | } 130 | } 131 | 132 | .searchSummary { 133 | @include type-body-supplemental(color(orange, 20)); 134 | @include all-caps; 135 | margin: 0.5rem 0; 136 | font-weight: 500; 137 | line-height: 2; 138 | } 139 | 140 | .noContent { 141 | @include no-content; 142 | margin: 2em 0; 143 | } 144 | -------------------------------------------------------------------------------- /source/app/components/SearchTypeTabs/SearchTypeTabs.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | $header-bg-color: color(gray, 90); 4 | 5 | .wrapper { 6 | @include full-bleed; 7 | background: $header-bg-color; 8 | display: flex; 9 | align-items: center; 10 | justify-content: center; 11 | position: sticky; 12 | top: 102px; 13 | z-index: 206; 14 | } 15 | 16 | .tab { 17 | flex: 0 1 20%; 18 | white-space: nowrap; 19 | padding-left: 1em; 20 | padding-right: 1em;; 21 | padding-top: 1em; 22 | padding-bottom: 0.5em; 23 | display: flex; 24 | flex-direction: column; 25 | align-items: center; 26 | border-top-left-radius: .5em; 27 | border-top-right-radius: .5em; 28 | cursor: pointer; 29 | 30 | span { 31 | font-size: 0.7em; 32 | } 33 | } 34 | 35 | .selected { 36 | background-color: color(gray, 80); 37 | } 38 | -------------------------------------------------------------------------------- /source/app/components/Table/Table.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .tableContainer { 4 | max-width: 100%; 5 | overflow: auto; 6 | 7 | @include media-grid(4) { 8 | padding-bottom: 1rem; 9 | 10 | table { 11 | min-width: rem(1000); 12 | } 13 | } 14 | } 15 | 16 | .muted { 17 | color: color(gray, 60); 18 | background-color: color(gray, 30); 19 | } 20 | -------------------------------------------------------------------------------- /source/app/components/TableDownloader/TableDownloader.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import React, { useMemo, useEffect } from 'react' 16 | 17 | import Button from '../Button/Button' 18 | 19 | import css from './TableDownloader.module.scss' 20 | 21 | export default function TableDownloader({ table, rows }) { 22 | const tableBlob = useMemo(() => { 23 | const csv = rows 24 | .map(row => { 25 | return row 26 | .map(cell => cell.content) 27 | .map(x => `"${x.replace(/"/g, '""')}"`) 28 | .join(',') 29 | }) 30 | .join('\n') 31 | return new Blob(['\ufeff', csv], { type: 'text/csv' }) 32 | }, [rows]) 33 | 34 | const url = useMemo(() => URL.createObjectURL(tableBlob), [tableBlob]) 35 | useEffect(() => { 36 | return () => { 37 | URL.revokeObjectURL(url) 38 | } 39 | }, [url]) 40 | 41 | const { Top, Left, Width, Height } = table.Geometry.BoundingBox 42 | 43 | return ( 44 | 56 | ) 57 | } 58 | -------------------------------------------------------------------------------- /source/app/components/TableDownloader/TableDownloader.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .button { 4 | position: absolute; 5 | z-index: 5; 6 | opacity: 0; 7 | margin-left: -2px; 8 | border-top-left-radius: 0; 9 | border-top-right-radius: 0; 10 | } 11 | 12 | mark:hover + .button, .button:hover { 13 | opacity: 1; 14 | } 15 | -------------------------------------------------------------------------------- /source/app/components/TableResults/TableResults.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | 4 | .tableList { 5 | @include absolute(0, 0, 0, 0); 6 | padding: rem(10) rem(20); 7 | margin: 0; 8 | overflow: auto; 9 | transition: opacity 200ms ease; 10 | opacity: 0; 11 | pointer-events: none; 12 | 13 | > ul { 14 | margin: 0; 15 | padding: 0; 16 | list-style: none; 17 | } 18 | } 19 | 20 | .visible { 21 | opacity: 1; 22 | pointer-events: all; 23 | } 24 | 25 | .ev { 26 | padding: rem(10) 0; 27 | margin-bottom: rem(10); 28 | opacity: 0.4; 29 | position: relative; 30 | 31 | &.onThisPage { 32 | opacity: 1; 33 | } 34 | 35 | h5 { 36 | @include type-body-primary; 37 | margin: 0; 38 | } 39 | 40 | p { 41 | @include type-body-secondary; 42 | margin: 0; 43 | } 44 | } 45 | 46 | .actions { 47 | display: flex; 48 | flex-direction: row; 49 | justify-content: center; 50 | 51 | > * { 52 | margin: rem(10) 0; 53 | } 54 | } 55 | 56 | .noTable { 57 | margin: rem(10); 58 | } 59 | 60 | .pageSeparator { 61 | font-size: .8em; 62 | text-transform: uppercase; 63 | padding-top: 1em; 64 | } 65 | 66 | 67 | -------------------------------------------------------------------------------- /source/app/components/Tabs/Tabs.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .tabs { 4 | display: block; 5 | 6 | nav { 7 | @include full-bleed; 8 | @include site-gutters; 9 | } 10 | 11 | ul { 12 | display: flex; 13 | padding: em(8) 0; 14 | } 15 | 16 | li { 17 | display: inline-block; 18 | } 19 | 20 | a { 21 | display: inline-block; 22 | padding: em(10) em(20); 23 | margin-right: em(10); 24 | font-weight: 500; 25 | color: $type-color-default; 26 | text-decoration: none; 27 | border-radius: 40px; 28 | 29 | &:hover, 30 | &:focus { 31 | background-color: color(gray, 90); 32 | outline: 0; 33 | } 34 | 35 | @include media(' { 24 | setOpen(open => !open); 25 | }, []); 26 | 27 | return ( 28 | <> 29 | {tooltip}} 31 | placement="top" 32 | open={open} 33 | styles={{ 34 | container: { 35 | backgroundColor: "#00a1c9", 36 | color: "#fff", 37 | borderRadius: 5, 38 | }, 39 | arrow: { 40 | color: "#00a1c9", 41 | }, 42 | options: { 43 | zIndex: open ? 600 : 100 44 | } 45 | }} 46 | > 47 | {React.cloneElement(children, { 48 | onClick 49 | })} 50 | 51 | 52 | {open && createPortal( 53 |
, 54 | document.body 55 | )} 56 | 57 | ); 58 | } 59 | -------------------------------------------------------------------------------- /source/app/components/TooltipButton/TooltipButton.module.scss: -------------------------------------------------------------------------------- 1 | .tip { 2 | h4 { 3 | font-size: 1.25em; 4 | margin: 0; 5 | } 6 | 7 | p { 8 | margin-top: 1em; 9 | margin-bottom: 0; 10 | line-height: 1.25; 11 | 12 | &:first-child { 13 | margin-top: 0; 14 | } 15 | } 16 | } 17 | 18 | .overlay { 19 | position: fixed; 20 | top: 0; 21 | left: 0; 22 | right: 0; 23 | bottom: 0; 24 | z-index: 400; 25 | } 26 | -------------------------------------------------------------------------------- /source/app/components/TrackInfoModal/TrackInfoModal.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import React from "react"; 15 | import { connect } from "react-redux"; 16 | import { getTracks } from "../../store/entities/tracks/selectors"; 17 | 18 | import Modal from "../Modal/Modal"; 19 | import Button from "../Button/Button"; 20 | import css from "./TrackInfoModal.module.scss"; 21 | 22 | function TrackInfoModal({ trackName, onNavigateToTrack, onClose, track }) { 23 | const descriptionParagraphs = (track.longDescription || "") 24 | .trim() 25 | .split(/(?:\n\s*){2,}/); 26 | 27 | return ( 28 | 29 | {descriptionParagraphs.map((text) => ( 30 |

{text}

31 | ))} 32 | 33 |
34 | 35 |
36 |
37 | ); 38 | } 39 | 40 | export default connect(function mapStateToProps(state, { trackName }) { 41 | return { 42 | track: getTracks(state).find((x) => x.id === trackName), 43 | }; 44 | })(TrackInfoModal); 45 | -------------------------------------------------------------------------------- /source/app/components/TrackInfoModal/TrackInfoModal.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .actions { 4 | text-align: right; 5 | } 6 | -------------------------------------------------------------------------------- /source/app/constants/action-types.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | export const SET_SELECTED_TRACK = 'ui/SET_SELECTED_TRACK' 16 | export const SET_HEADER_PROPS = 'ui/SET_HEADER_PROPS' 17 | export const SET_SELECTED_SEARCH = 'ui/SET_SELECTED_SEARCH' 18 | export const DISMISS_WALKTHROUGH = 'ui/DISMISS_WALKTHROUGH' 19 | 20 | export const SUBMIT_DOCUMENT = 'api/SUBMIT_DOCUMENT' 21 | export const SUBMIT_DOCUMENTS = 'api/SUBMIT_DOCUMENTS' 22 | export const FETCH_DOCUMENTS = 'api/FETCH_DOCUMENTS' 23 | export const FETCH_DOCUMENT = 'api/FETCH_DOCUMENT' 24 | export const REDACT_DOCUMENT = 'api/REDACT_DOCUMENT' 25 | export const HIGHLIGHT_DOCUMENT = 'api/HIGHLIGHT_DOCUMENT' 26 | export const SEARCH = 'api/SEARCH' 27 | export const CLEAR_SEARCH_RESULTS = 'searchResults/CLEAR' 28 | export const SUBMIT_FEEDBACK = 'api/SUBMIT_FEEDBACK' 29 | 30 | export const SET_CURRENT_PAGE_NUMBER = 'meta/SET_CURRENT_PAGE_NUMBER' 31 | export const SET_DOCUMENTS_NEXT_TOKEN = 'meta/SET_DOCUMENTS_NEXT_TOKEN' 32 | export const SET_SEARCH_QUERY = 'meta/SET_SEARCH_QUERY' 33 | export const SET_DOCUMENT_SEARCH_QUERY = 'meta/SET_DOCUMENT_SEARCH_QUERY' 34 | export const SET_SEARCH_STATUS = 'meta/SET_SEARCH_STATUS' 35 | export const CLEAR_SEARCH_QUERY = 'meta/CLEAR_SEARCH_QUERY' 36 | export const CLEAR_DOCUMENT_SEARCH_QUERY = 'meta/CLEAR_DOCUMENT_SEARCH_QUERY' 37 | export const SET_SEARCH_PERSONA = 'meta/SET_SEARCH_PERSONA' 38 | -------------------------------------------------------------------------------- /source/app/constants/configs.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | export const MIN_SEARCH_QUERY_LENGTH = 4 16 | export const ENABLE_KENDRA = process.env.NEXT_PUBLIC_ENABLE_KENDRA === 'true' 17 | -------------------------------------------------------------------------------- /source/app/pages/_document.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | // _document is only rendered on the server side and not on the client side 16 | // Event handlers like onClick can't be added to this file 17 | import Document, { Html, Head, Main, NextScript } from 'next/document' 18 | 19 | class MyDocument extends Document { 20 | static async getInitialProps(ctx) { 21 | const initialProps = await Document.getInitialProps(ctx) 22 | return { ...initialProps } 23 | } 24 | 25 | render() { 26 | return ( 27 | 28 | 29 | 30 |
31 | 32 | 33 | 34 | ) 35 | } 36 | } 37 | 38 | export default MyDocument 39 | -------------------------------------------------------------------------------- /source/app/pages/_error.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import React from 'react' 16 | import PropTypes from 'prop-types' 17 | import { reject, isNil } from 'ramda' 18 | 19 | import Button from '../components/Button/Button' 20 | 21 | import css from './error.module.scss' 22 | 23 | Error.propTypes = { 24 | statusCode: PropTypes.number, 25 | } 26 | 27 | Error.getInitialProps = function({ res, err }) { 28 | const statusCode = res ? res.statusCode : err ? err.statusCode : null 29 | return reject(isNil, { 30 | pageTitle: 'Error', 31 | statusCode, 32 | }) 33 | } 34 | 35 | export default function Error({ statusCode }) { 36 | return ( 37 |
38 | {statusCode ? ( 39 |

40 | A {statusCode} error occurred on server. Please refresh the page and try again. 41 |

42 | ) : ( 43 |

Something went wrong. Please refresh the page and try again.

44 | )} 45 | 46 |

47 | 48 |

49 |
50 | ) 51 | } 52 | -------------------------------------------------------------------------------- /source/app/pages/app.scss: -------------------------------------------------------------------------------- 1 | @import '../styles/shared/index'; 2 | 3 | $grid-color: rgba(color(magenta, 30), 0.1); 4 | $grid-color-alternate: rgba(color(magenta, 30), 0.1); 5 | 6 | .container { 7 | display: flex; 8 | flex-direction: column; 9 | height: 100%; 10 | width: 100%; 11 | position: absolute; 12 | 13 | > main { 14 | flex: 1 1 0px; 15 | overflow: auto; 16 | } 17 | } 18 | 19 | // Grid overlay styles 20 | .gridContainer { 21 | @include fixed(0, 0, 0, 0); 22 | @include site-gutters; 23 | z-index: 2; 24 | display: flex; 25 | pointer-events: none; 26 | 27 | // This background will render 4px horizontal stripes 28 | background: linear-gradient( 29 | to bottom, 30 | $grid-color-alternate, 31 | $grid-color-alternate 50%, 32 | transparent 50%, 33 | transparent 34 | ); 35 | background-size: 100% rem(8); 36 | } 37 | 38 | .gridCol { 39 | width: span(1); 40 | height: 100%; 41 | margin-right: gutter(); 42 | background-color: $grid-color; 43 | 44 | &:last-child { 45 | margin-right: 0; 46 | } 47 | 48 | @include media-grid(8) { 49 | width: span(1, $grid-8col); 50 | margin-right: gutter($grid-8col); 51 | 52 | &:nth-last-child(-n+4) { 53 | display: none; 54 | } 55 | 56 | &:nth-child(0n+8) { 57 | margin-right: 0; 58 | } 59 | } 60 | 61 | @include media-grid(4) { 62 | width: span(1, $grid-4col); 63 | margin-right: gutter($grid-4col); 64 | 65 | &:nth-last-child(-n+8) { 66 | display: none; 67 | } 68 | 69 | &:nth-child(0n+4) { 70 | margin-right: 0; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /source/app/pages/documents/view.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .document { 4 | position: relative; 5 | height: 100%; 6 | min-height: rem(300); 7 | display: flex; 8 | flex-direction: column; 9 | } 10 | 11 | .tabs, 12 | .tabs nav { 13 | margin-bottom: 3em; 14 | } 15 | 16 | .tabWrapper { 17 | @include full-bleed; 18 | @include site-gutters; 19 | background: color(gray, 95); 20 | } 21 | 22 | // Search Bar 23 | .searchBarWrapper { 24 | width: span(8); 25 | margin: 0 auto; 26 | 27 | @include media-grid(8) { 28 | width: span(6, $grid-8col); 29 | } 30 | 31 | @include media-grid(4) { 32 | width: 100%; 33 | } 34 | } 35 | 36 | .downloadButtons { 37 | > * + * { 38 | margin-left: rem(10); 39 | } 40 | } 41 | 42 | .tabSourceViewer { 43 | flex: 1; 44 | margin: 0 auto; 45 | transition: width 300ms ease; 46 | } 47 | 48 | .downloadRedacted { 49 | margin-left: rem(5); 50 | } 51 | 52 | .content { 53 | @include full-bleed; 54 | flex: 1; 55 | display: flex; 56 | flex-direction: row; 57 | overflow: hidden; 58 | position: relative; 59 | } 60 | 61 | .tabWrapper { 62 | display: flex; 63 | flex-direction: row; 64 | justify-content: space-between; 65 | align-items: center; 66 | } 67 | 68 | .searchBar { 69 | flex: 1; 70 | // margin-right: rem(20); 71 | 72 | + * { 73 | margin-left: rem(20); 74 | } 75 | } 76 | 77 | .searchBarWrapper { 78 | transition: flex-basis 300ms ease; 79 | flex: 0 0 0px; 80 | overflow: hidden; 81 | display: flex; 82 | flex-direction: row; 83 | align-items: center; 84 | 85 | &.visible { 86 | flex: 0 0 64px; 87 | } 88 | } 89 | 90 | .trackBorder{ 91 | border-style: dotted; 92 | } 93 | .sidebar { 94 | transition: flex-basis 300ms ease, opacity 300ms ease; 95 | flex: 0 0 0px; 96 | position: relative; 97 | overflow: hidden; 98 | opacity: 0; 99 | margin: 0; 100 | background: color(gray, 70); 101 | box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); 102 | padding: 0; 103 | display: flex; 104 | flex-direction: column; 105 | 106 | 107 | &.visible { 108 | opacity: 1; 109 | flex: 0 0 30%; 110 | 111 | } 112 | 113 | &.wide { 114 | flex: 0 0 50%; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /source/app/pages/error.module.scss: -------------------------------------------------------------------------------- 1 | @import '../styles/shared/index'; 2 | 3 | .error { 4 | min-height: rem(300); 5 | text-align: center; 6 | } 7 | 8 | .message { 9 | @include no-content; 10 | } 11 | -------------------------------------------------------------------------------- /source/app/pages/home.module.scss: -------------------------------------------------------------------------------- 1 | @import '../styles/shared/index'; 2 | 3 | .home { 4 | width: span(8); 5 | margin: 3rem auto 1rem; 6 | min-width: 800px; 7 | 8 | > p img { 9 | display: inline-block; 10 | margin-right: 0.25em; 11 | vertical-align: text-bottom; 12 | } 13 | 14 | @include media-grid(8) { 15 | width: span(6, $grid-8col); 16 | min-width: 0; 17 | } 18 | 19 | @include media-grid(4) { 20 | width: 100%; 21 | } 22 | } 23 | 24 | .tracks { 25 | margin: 2rem auto; 26 | display: flex; 27 | flex-direction: row; 28 | 29 | > * { 30 | margin-bottom: 1rem; 31 | flex: 1 1 0px; 32 | } 33 | 34 | @include media-grid(8) { 35 | flex-direction: column; 36 | 37 | > * { 38 | flex: 1 0 auto; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /source/app/pages/login.module.scss: -------------------------------------------------------------------------------- 1 | @import '../styles/shared/index'; 2 | 3 | .form { 4 | position: relative; 5 | width: span(4); 6 | margin: 0 auto; 7 | 8 | label { 9 | display: block; 10 | } 11 | 12 | @include media-grid(8) { 13 | width: span(4, $grid-8col); 14 | } 15 | 16 | @include media-grid(4) { 17 | width: span(4, $grid-4col); 18 | } 19 | } 20 | 21 | .error { 22 | font-weight: 500; 23 | color: color(red); 24 | } 25 | -------------------------------------------------------------------------------- /source/app/pages/select.module.scss: -------------------------------------------------------------------------------- 1 | @import '../styles/shared/index'; 2 | 3 | .select { 4 | display: block; 5 | padding-bottom: 2rem; 6 | 7 | > p { 8 | text-align: center; 9 | margin-top: 2rem; 10 | } 11 | 12 | > h2 { 13 | @include type-heading-h4(); 14 | width: span(6); 15 | margin: 5rem auto .5rem; 16 | } 17 | 18 | @include media-grid(8) { 19 | > h2 { 20 | width: span(6, $grid-8col); 21 | } 22 | } 23 | 24 | @include media-grid(4) { 25 | > h2 { 26 | width: 100%; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /source/app/pages/styleguide/styleguide.module.scss: -------------------------------------------------------------------------------- 1 | @import '../../styles/shared/index'; 2 | 3 | .colors { 4 | padding: 0; 5 | margin: 0 -1%; 6 | list-style-type: none; 7 | 8 | li { 9 | position: relative; 10 | display: inline-block; 11 | width: 18%; 12 | padding-top: 12%; 13 | margin: 1%; 14 | border: 1px solid color(gray, 40); 15 | 16 | @include media(' div { 80 | display: inline-block; 81 | width: span(6); 82 | margin-right: gutter(); 83 | margin-bottom: gutter(); 84 | vertical-align: top; 85 | 86 | &:nth-child(odd) { 87 | margin-right: 0; 88 | } 89 | } 90 | 91 | a, 92 | button { 93 | margin-right: 1em; 94 | } 95 | } 96 | 97 | 98 | .loading { 99 | position: relative; 100 | min-height: 200px; 101 | padding: 1em; 102 | background: color(white); 103 | border: 1px solid color(gray, 50); 104 | } 105 | -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember-md.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember-md.woff -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember-md.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember-md.woff2 -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember-mdit.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember-mdit.woff -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember-mdit.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember-mdit.woff2 -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_bd.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_bd.woff -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_bd.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_bd.woff2 -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_bdit.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_bdit.woff -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_bdit.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_bdit.woff2 -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_rg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_rg.woff -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_rg.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_rg.woff2 -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_rgit.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_rgit.woff -------------------------------------------------------------------------------- /source/app/static/fonts/amazon-ember_rgit.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/fonts/amazon-ember_rgit.woff2 -------------------------------------------------------------------------------- /source/app/static/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/favicon.ico -------------------------------------------------------------------------------- /source/app/static/images/general-public.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/general-public.png -------------------------------------------------------------------------------- /source/app/static/images/healthcare-provider.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/healthcare-provider.png -------------------------------------------------------------------------------- /source/app/static/images/icon_back.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_close.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_cloud-search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_delete.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_delete_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/icon_delete_01.png -------------------------------------------------------------------------------- /source/app/static/images/icon_document.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_error.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_feature.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_file-upload.svg: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /source/app/static/images/icon_home.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_pencil.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_previous.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_redact.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_search.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_success.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/icon_tip.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /source/app/static/images/icon_workflow.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /source/app/static/images/nofilter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /source/app/static/images/sample-previews/Lacey city bonds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/sample-previews/Lacey city bonds.png -------------------------------------------------------------------------------- /source/app/static/images/sample-previews/employmentapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/sample-previews/employmentapp.png -------------------------------------------------------------------------------- /source/app/static/images/sample-previews/expense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/sample-previews/expense.png -------------------------------------------------------------------------------- /source/app/static/images/sample-previews/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/sample-previews/history.png -------------------------------------------------------------------------------- /source/app/static/images/sample-previews/management.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/sample-previews/management.png -------------------------------------------------------------------------------- /source/app/static/images/scientist.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/scientist.png -------------------------------------------------------------------------------- /source/app/static/images/touch-icon-ipad-144-smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/touch-icon-ipad-144-smile.png -------------------------------------------------------------------------------- /source/app/static/images/touch-icon-iphone-114-smile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/app/static/images/touch-icon-iphone-114-smile.png -------------------------------------------------------------------------------- /source/app/store/entities/data.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { trackSchema } from './tracks/data.js' 16 | 17 | export const entitySchemas = { 18 | track: trackSchema, 19 | } 20 | -------------------------------------------------------------------------------- /source/app/store/entities/documents/data.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { schema } from 'normalizr' 16 | import { lensPath } from 'ramda' 17 | 18 | // Document Schemas 19 | export const documentSchema = new schema.Entity( 20 | 'documents', 21 | {}, 22 | { 23 | idAttribute: 'documentId', 24 | } 25 | ) 26 | export const documentsSchema = new schema.Array(documentSchema) 27 | 28 | // Document Lenses 29 | export const lensDocuments = lensPath(['entities', 'documents']) 30 | export const lensDocument = id => lensPath(['entities', 'documents', id]) 31 | 32 | // Initial Data 33 | export default {} 34 | -------------------------------------------------------------------------------- /source/app/store/entities/documents/selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { values, view, sortBy, prop, reverse, filter, complement } from 'ramda' 16 | 17 | import { lensDocument, lensDocuments } from './data' 18 | 19 | export const getDocuments = state => 20 | reverse( 21 | sortBy(prop('documentCreatedOn'))( 22 | filter(complement(prop('deleted')), values(view(lensDocuments, state))) 23 | ) 24 | ) 25 | export const getDocumentById = (state, id) => view(lensDocument(id), state) 26 | -------------------------------------------------------------------------------- /source/app/store/entities/meta/data.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { lensPath } from 'ramda' 16 | 17 | // Meta Lenses 18 | export const getMetaLens = key => lensPath(['entities', 'meta', key]) 19 | 20 | // Initial Data 21 | export default { 22 | currentPageNumber: 1, 23 | documentsNextToken: null, 24 | documentsTotal: 0, 25 | searchQuery: '', 26 | searchPersona: undefined, 27 | searchStatus: '', 28 | searchTotalDocuments: 0, 29 | searchTotalMatches: 0, 30 | } 31 | -------------------------------------------------------------------------------- /source/app/store/entities/meta/selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { pipe, trim, view } from 'ramda' 16 | import { getMetaLens } from './data' 17 | 18 | export const getCurrentPageNumber = state => view(getMetaLens('currentPageNumber'), state) 19 | export const getDocumentsNextToken = state => view(getMetaLens('documentsNextToken'), state) 20 | export const getDocumentsTotal = state => view(getMetaLens('documentsTotal'), state) 21 | export const getSearchQuery = state => view(getMetaLens('searchQuery'), state) 22 | export const getDocumentSearchQuery = state => view(getMetaLens('documentSearchQuery'), state) 23 | export const getCleanSearchQuery = state => 24 | pipe( 25 | view(getMetaLens('searchQuery')), 26 | trim 27 | )(state) 28 | export const getSearchPersona = state => view(getMetaLens('searchPersona'), state) 29 | export const getSearchStatus = state => view(getMetaLens('searchStatus'), state) 30 | export const getSearchTotalDocuments = state => view(getMetaLens('searchTotalDocuments'), state) 31 | export const getSearchTotalMatches = state => view(getMetaLens('searchTotalMatches'), state) 32 | export const getKendraQueryId = state => view(getMetaLens('kendraQueryId'), state); 33 | export const getKendraFilteredQueryId = state => view(getMetaLens('kendraFilteredQueryId'), state); 34 | export const getKendraResultCount = state => view(getMetaLens('kendraTotalResults'), state); 35 | export const getKendraFilteredResultCount = state => view(getMetaLens('kendraTotalFilteredResults'), state); 36 | -------------------------------------------------------------------------------- /source/app/store/entities/sampleDocuments/selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { values, view } from 'ramda' 16 | 17 | import { lensSampleDocuments, lensSampleCollections } from './data' 18 | 19 | export const getSampleDocuments = state => values(view(lensSampleDocuments, state)) 20 | export const getSampleCollections = state => values(view(lensSampleCollections, state)) 21 | -------------------------------------------------------------------------------- /source/app/store/entities/searchResults/data.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { schema } from 'normalizr' 16 | import { lensPath } from 'ramda' 17 | 18 | // Search Result Schemas 19 | export const searchResultSchema = new schema.Entity( 20 | 'searchResults', 21 | {}, 22 | { 23 | idAttribute: 'documentId', 24 | } 25 | ) 26 | export const searchResultsSchema = new schema.Array(searchResultSchema) 27 | 28 | export const kendraResultSchema = new schema.Entity( 29 | 'kendraResults', 30 | {}, 31 | { 32 | idAttribute: 'Id', 33 | } 34 | ) 35 | export const kendraResultsSchema = new schema.Array(kendraResultSchema) 36 | 37 | export const kendraFilteredResultSchema = new schema.Entity( 38 | 'kendraFilteredResults', 39 | {}, 40 | { 41 | idAttribute: 'Id', 42 | } 43 | ) 44 | export const kendraFilteredResultsSchema = new schema.Array(kendraFilteredResultSchema) 45 | 46 | // Search Result Lenses 47 | export const lensSearchResults = lensPath(['entities', 'searchResults']) 48 | export const lensSearchResult = id => lensPath(['entities', 'searchResults', id]) 49 | export const lensKendraResults = lensPath(['entities', 'kendraResults']) 50 | export const lensKendraFilteredResults = lensPath(['entities', 'kendraFilteredResults']) 51 | 52 | 53 | // Initial Data 54 | export default {} 55 | -------------------------------------------------------------------------------- /source/app/store/entities/searchResults/selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { values, view } from 'ramda' 16 | 17 | import { lensSearchResults, lensSearchResult, lensKendraResults, lensKendraFilteredResults } from './data' 18 | 19 | export const getSearchResults = state => values(view(lensSearchResults, state)) 20 | export const getSearchResultById = (state, id) => view(lensSearchResult(id), state) 21 | export const getKendraResults = state => values(view(lensKendraResults, state)); 22 | export const getKendraFilteredResults = state => values(view(lensKendraFilteredResults, state)); 23 | -------------------------------------------------------------------------------- /source/app/store/entities/tracks/selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { values, view } from 'ramda' 16 | 17 | import { lensTrack, lensTracks } from './data' 18 | 19 | export const getTracks = state => values(view(lensTracks, state)) 20 | export const getTrackById = (state, id) => view(lensTrack(id), state) 21 | -------------------------------------------------------------------------------- /source/app/store/reducer.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { combineReducers } from 'redux' 16 | import entities from './entities/reducer.js' 17 | import ui from './ui/reducer.js' 18 | 19 | export default function makeRootReducer() { 20 | return combineReducers({ 21 | entities, 22 | ui, 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /source/app/store/store.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { createStore, applyMiddleware } from 'redux' 16 | import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly' 17 | import thunkMiddleware from 'redux-thunk' 18 | import promiseMiddleware from 'redux-promise' 19 | 20 | import makeRootReducer from './reducer.js' 21 | 22 | const baseInitialState = {} 23 | 24 | export default function initStore(initialState = baseInitialState) { 25 | // Middleware Configuration 26 | // =========================================================================== 27 | const middleware = [thunkMiddleware, promiseMiddleware] 28 | 29 | // Create Store 30 | // =========================================================================== 31 | const store = createStore( 32 | makeRootReducer(), 33 | initialState, 34 | composeWithDevTools(applyMiddleware(...middleware)) 35 | ) 36 | 37 | /* istanbul ignore next */ 38 | if (module.hot) { 39 | module.hot.accept('./reducer', () => { 40 | const { default: reducer } = require('./reducer') 41 | store.replaceReducer(reducer()) 42 | }) 43 | } 44 | 45 | return store 46 | } 47 | -------------------------------------------------------------------------------- /source/app/store/ui/actions.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { createAction } from 'redux-actions' 16 | import { set } from 'ramda' 17 | 18 | import { SET_SELECTED_TRACK, SET_HEADER_PROPS, SET_SELECTED_SEARCH, DISMISS_WALKTHROUGH } from '../../constants/action-types.js' 19 | import { lensSelectedTrack, lensHeaderProps, lensSelectedSearch, lensDismissedWalkthrough } from './data' 20 | 21 | export const setSelectedTrack = createAction(SET_SELECTED_TRACK, selectedTrack => { 22 | localStorage.setItem('track', selectedTrack) 23 | return set(lensSelectedTrack, selectedTrack, {}) 24 | }) 25 | 26 | export const setHeaderProps = createAction(SET_HEADER_PROPS, props => 27 | set(lensHeaderProps, props, {}) 28 | ) 29 | 30 | export const setSelectedSearch = createAction(SET_SELECTED_SEARCH, searchType => 31 | set(lensSelectedSearch, searchType, {}) 32 | ) 33 | 34 | export const dismissWalkthrough = createAction(DISMISS_WALKTHROUGH, () => { 35 | localStorage.setItem('dismissedWalkthrough', 1); 36 | return set(lensDismissedWalkthrough, true, {}) 37 | }) 38 | -------------------------------------------------------------------------------- /source/app/store/ui/data.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { lensPath } from 'ramda' 16 | 17 | export default { 18 | selectedTrack: 'search', 19 | selectedSearch: 'es', 20 | headerProps: {}, 21 | } 22 | 23 | export const lensSelectedTrack = lensPath(['ui', 'selectedTrack']) 24 | export const lensHeaderProps = lensPath(['ui', 'headerProps']) 25 | export const lensSelectedSearch = lensPath(['ui', 'selectedSearch']) 26 | export const lensDismissedWalkthrough = lensPath(['ui', 'dismissedWalkthrough']) 27 | -------------------------------------------------------------------------------- /source/app/store/ui/reducer.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { handleActions } from 'redux-actions' 16 | 17 | import initialState from './data' 18 | import { SET_SELECTED_TRACK, SET_HEADER_PROPS, SET_SELECTED_SEARCH, DISMISS_WALKTHROUGH } from '../../constants/action-types.js' 19 | 20 | export function uiReducer(state, { payload }) { 21 | return { 22 | ...state, 23 | ...payload.ui, 24 | } 25 | } 26 | 27 | export default handleActions( 28 | { 29 | [SET_SELECTED_TRACK]: uiReducer, 30 | [SET_SELECTED_SEARCH]: uiReducer, 31 | [SET_HEADER_PROPS]: uiReducer, 32 | [DISMISS_WALKTHROUGH]: uiReducer 33 | }, 34 | initialState 35 | ) 36 | -------------------------------------------------------------------------------- /source/app/store/ui/selectors.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | import { view } from 'ramda' 16 | import { lensSelectedTrack, lensHeaderProps, lensSelectedSearch, lensDismissedWalkthrough } from './data' 17 | 18 | import { getTrackById } from '../../store/entities/tracks/selectors' 19 | 20 | export const getSelectedTrackId = state => view(lensSelectedTrack, state) 21 | export const getSelectedTrack = state => getTrackById(state, getSelectedTrackId(state)) 22 | export const getSelectedSearch = state => view(lensSelectedSearch, state) 23 | export const getHasDismissedWalkthrough = state => view(lensDismissedWalkthrough, state) 24 | 25 | export const getHeaderProps = state => view(lensHeaderProps, state) 26 | -------------------------------------------------------------------------------- /source/app/styles/_fonts.scss: -------------------------------------------------------------------------------- 1 | // sass-lint:disable property-sort-order 2 | 3 | // Amazon Ember 4 | // ============================================================================= 5 | 6 | // Regular 7 | @font-face { 8 | font-family: 'Amazon Ember'; 9 | src: url('/static/fonts/amazon-ember_rg.woff2'), 10 | url('/static/fonts/amazon-ember_rg.woff'); 11 | font-weight: normal; 12 | font-style: normal; 13 | } 14 | 15 | // Regular Italic 16 | @font-face { 17 | font-family: 'Amazon Ember'; 18 | src: url('/static/fonts/amazon-ember_rgit.woff2'), 19 | url('/static/fonts/amazon-ember_rgit.woff'); 20 | font-weight: normal; 21 | font-style: italic; 22 | } 23 | 24 | // Medium 25 | @font-face { 26 | font-family: 'Amazon Ember'; 27 | src: url('/static/fonts/amazon-ember-md.woff2'), 28 | url('/static/fonts/amazon-ember-md.woff'); 29 | font-weight: 500; 30 | font-style: normal; 31 | } 32 | 33 | // Medium Italic 34 | @font-face { 35 | font-family: 'Amazon Ember'; 36 | src: url('/static/fonts/amazon-ember-mdit.woff2'), 37 | url('/static/fonts/amazon-ember-mdit.woff'); 38 | font-weight: 500; 39 | font-style: italic; 40 | } 41 | 42 | // Bold 43 | @font-face { 44 | font-family: 'Amazon Ember'; 45 | src: url('/static/fonts/amazon-ember_bd.woff2'), 46 | url('/static/fonts/amazon-ember_bd.woff'); 47 | font-weight: 700; 48 | font-style: normal; 49 | } 50 | 51 | // Bold Italic 52 | @font-face { 53 | font-family: 'Amazon Ember'; 54 | src: url('/static/fonts/amazon-ember_bdit.woff2'), 55 | url('/static/fonts/amazon-ember_bdit.woff'); 56 | font-weight: 700; 57 | font-style: italic; 58 | } 59 | -------------------------------------------------------------------------------- /source/app/styles/shared/_breakpoints.scss: -------------------------------------------------------------------------------- 1 | // MEDIA QUERIES 2 | // ============================================================================= 3 | $breakpoints: ( 4 | mobileSmall: em(320), 5 | mobileMedium: em(375), 6 | mobileLarge: em(480), 7 | mobileLandscape: em(568), 8 | tabletPortraitSmall: em(600), 9 | tabletPortrait: em(768), 10 | mobileLandscapeLarge: em(812), 11 | tabletLandscapeSmall: em(960), 12 | tabletLandscape: em(1024), 13 | desktopSmall: em(1280), 14 | desktopMedium: em(1440), 15 | desktopLarge: em(1920), 16 | desktopHD: em(2560) 17 | ); 18 | 19 | // More info: http://include-media.com 20 | @import '../vendor/include-media'; 21 | -------------------------------------------------------------------------------- /source/app/styles/shared/_colors.scss: -------------------------------------------------------------------------------- 1 | $palettes: ( 2 | orange: ( 3 | core: #f6761d, 4 | 10: #ffcc83, 5 | 20: #f90, 6 | 30: #f6761d, 7 | 40: #d45b07 8 | ), 9 | purple: ( 10 | core: #4d27aa, 11 | 10: #c5a1ff, 12 | 20: #955cef, 13 | 30: #753bd2, 14 | 40: #4d27aa 15 | ), 16 | red: ( 17 | core: #bf0816, 18 | 10: #ffa7a7, 19 | 20: #ff5252, 20 | 30: #db2d2d, 21 | 40: #bf0816 22 | ), 23 | blue: ( 24 | core: #153eb3, 25 | 10: #95b0ff, 26 | 20: #527fff, 27 | 30: #2c59dc, 28 | 40: #153eb3 29 | ), 30 | magenta: ( 31 | core: #b0084d, 32 | 10: #f79bc5, 33 | 20: #ff4f8b, 34 | 30: #dc2d69, 35 | 40: #b0084d 36 | ), 37 | teal: ( 38 | core: #00604e, 39 | 10: #67e6be, 40 | 20: #16bf9f, 41 | 30: #067f68, 42 | 40: #00604e 43 | ), 44 | gray: ( 45 | core: #545b64, 46 | 10: #fff, 47 | 20: #f2f4f4, 48 | 30: #eaeded, 49 | 40: #d5dbdb, 50 | 50: #aab7b8, 51 | 60: #879196, 52 | 70: #49525f, 53 | 80: #3b4550, 54 | 90: #272d3a, 55 | 95: #181d2b, 56 | 100: #000 57 | ), 58 | black: ( 59 | core: #000 60 | ), 61 | white: ( 62 | core: #fff 63 | ) 64 | ); 65 | 66 | // color 67 | // @param {string} name The name of the color palette defined in the map above 68 | // 69 | // Usage: 70 | // background: color('blue') => #153EB3 71 | // background: color('blue', 10) => #95B0FF 72 | @function color($palette, $tone: 'core') { 73 | @return map-get(map-get($palettes, $palette), $tone); 74 | } 75 | 76 | $link-blue: #00a1c9; 77 | -------------------------------------------------------------------------------- /source/app/styles/shared/_index.scss: -------------------------------------------------------------------------------- 1 | @import './colors'; 2 | @import './sizing'; 3 | @import './breakpoints'; 4 | @import './typography'; 5 | @import './grids'; 6 | @import './utils'; 7 | -------------------------------------------------------------------------------- /source/app/styles/shared/_sizing.scss: -------------------------------------------------------------------------------- 1 | $base-font-size: 16; 2 | $base-viewport-width: 1920; 3 | 4 | // Given a unitless number and an optional context, calculate a size in rem. 5 | // 6 | // @param {number} $size A unitless number to convert to a size in rem 7 | // @param {number} $context A unitless number that acts as the divisor 8 | // @return {number} The size in rem 9 | @function rem($size, $context: $base-font-size) { 10 | @return ($size / $context) * 1rem; 11 | } 12 | 13 | // Given a unitless number and an optional context, calculate a size in rem. 14 | // 15 | // @param {number} $size A unitless number to convert to a size in rem 16 | // @param {number} $context A unitless number that acts as the divisor 17 | // @return {number} The size in rem 18 | @function em($size, $context: $base-font-size) { 19 | @return ($size / $context) * 1em; 20 | } 21 | 22 | // Given a unitless number and an optional context, calculate a size in vw. 23 | // 24 | // @param {number} $size A unitless number to convert to a size in vw 25 | // @param {number} $context A unitless number that acts as the divisor 26 | // @return {number} The size in vw 27 | @function vw($size, $context: $base-viewport-width) { 28 | @return ($size / $context * 100) * 1vw; 29 | } 30 | -------------------------------------------------------------------------------- /source/app/styles/shared/_utils.scss: -------------------------------------------------------------------------------- 1 | // Shorthand mixin for offset positioning 2 | // https://css-tricks.com/snippets/sass/mixin-offset-positioning/ 3 | // 4 | // @param {String} $position - Either `relative`, `absolute` or `fixed` 5 | // @param {Length} $top [null] - Top offset 6 | // @param {Length} $right [null] - Right offset 7 | // @param {Length} $bottom [null] - Bottom offset 8 | // @param {Length} $left [null] - Left offset 9 | @mixin position($position, $top: null, $right: null, $bottom: null, $left: null) { 10 | position: $position; 11 | top: $top; 12 | right: $right; 13 | bottom: $bottom; 14 | left: $left; 15 | } 16 | 17 | // Shorthand mixin for absolute positioning 18 | // Serves as an alias for `position(absolute, ...)` 19 | // @param {Arglist} $args - Offsets 20 | // @require {mixin} position 21 | @mixin absolute($args...) { 22 | @include position(absolute, $args...); 23 | } 24 | 25 | // Shorthand mixin for relative positioning 26 | // Serves as an alias for `position(relative, ...)` 27 | // @param {Arglist} $args - Offsets 28 | // @require {mixin} position 29 | @mixin relative($args...) { 30 | @include position(relative, $args...); 31 | } 32 | 33 | // Shorthand mixin for fixed positioning 34 | // Serves as an alias for `position(fixed, ...)` 35 | // @param {Arglist} $args - Offsets 36 | // @require {mixin} position 37 | @mixin fixed($args...) { 38 | @include position(fixed, $args...); 39 | } 40 | 41 | // Include clearfix boilerplate 42 | @mixin clearfix() { 43 | &:before, 44 | &:after { 45 | display: table; 46 | content: ''; 47 | } 48 | 49 | &:after { 50 | clear: both; 51 | } 52 | } 53 | 54 | 55 | // Hide element from view. Used to hide radios, checkboxes, and file upload elements. 56 | @mixin remove-from-view() { 57 | position: absolute; 58 | clip: rect(0 0 0 0); 59 | } 60 | 61 | 62 | @mixin tab-content-sizing { 63 | position: relative; 64 | width: span(8); 65 | margin: 0 auto; 66 | 67 | .tooltip { 68 | @include absolute(em(48, 28), 100%, null, null); 69 | @include type-heading-h3; 70 | z-index: 1; 71 | display: flex; 72 | margin-right: gutter(of 8); 73 | transform: translateY(-50%); 74 | } 75 | 76 | @include media-grid(8) { 77 | width: span(6, $grid-8col); 78 | 79 | .tooltip { 80 | margin-right: gutter(of 6, $grid-8col); 81 | } 82 | } 83 | 84 | @include media-grid(4) { 85 | width: 100%; 86 | 87 | .tooltip { 88 | right: auto; 89 | left: 0; 90 | margin-right: 0; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /source/app/utils/dus-constants.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | export const COMPREHEND_SERVICE = 'COMPREHEND' 16 | export const COMPREHEND_MEDICAL_SERVICE = 'COMPREHEND_MEDICAL' 17 | -------------------------------------------------------------------------------- /source/bin/config.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | require("dotenv").config(); 16 | const config = () => { 17 | const { 18 | env: { 19 | region, 20 | UserPoolClientId, 21 | UserPoolId, 22 | FileBucketName, 23 | IdentityPoolId, 24 | APIGateway, 25 | isROMode 26 | } 27 | } = process; 28 | return { 29 | region, 30 | UserPoolClientId, 31 | UserPoolId, 32 | FileBucketName, 33 | IdentityPoolId, 34 | APIGateway, 35 | isROMode 36 | }; 37 | }; 38 | module.exports = config; 39 | -------------------------------------------------------------------------------- /source/bin/deploy-backend.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | const cdk = require("@aws-cdk/core"); 16 | const CdkTextractStack = require("../lib/cdk-textract-stack"); 17 | const readlineSync = require("readline-sync"); 18 | const fs = require("fs"); 19 | 20 | const app = new cdk.App(); 21 | const stackName = `${process.env.STACKNAME}Stack`; 22 | 23 | 24 | const userEmail = 25 | process.env.USER_EMAIL == "%%USER_EMAIL%%" 26 | ? readlineSync.question("Please enter your email address: ") 27 | : process.env.USER_EMAIL; 28 | 29 | const isCICDDeploy = process.env.ISCICD == "false" ? false : true; 30 | const enableKendra = process.env.ENABLE_KENDRA == "true"? true : false; 31 | // // eslint-disable-next-line no-new 32 | new CdkTextractStack.CdkTextractStack(app, stackName, { 33 | description : "MLSLD-S0001. Document Understanding Solution. This stack deploys the backend for DUS", 34 | email: userEmail, 35 | isCICDDeploy: isCICDDeploy, 36 | enableKendra: enableKendra 37 | }); 38 | -------------------------------------------------------------------------------- /source/bin/deploy-client-stack.js: -------------------------------------------------------------------------------- 1 | 2 | /********************************************************************************************************************** 3 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 4 | * * 5 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 6 | * with the License. A copy of the License is located at * 7 | * * 8 | * http://www.apache.org/licenses/LICENSE-2.0 * 9 | * * 10 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 11 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 12 | * and limitations under the License. * 13 | *********************************************************************************************************************/ 14 | 15 | const cdk = require("@aws-cdk/core"); 16 | const CdkTextractClientStack = require("../lib/cdk-textract-client-stack"); 17 | 18 | const app = new cdk.App(); 19 | const stackName = `${process.env.STACKNAME}ClientStack`; 20 | 21 | // eslint-disable-next-line no-new 22 | new CdkTextractClientStack.CdkTextractClientStack(app, stackName); 23 | -------------------------------------------------------------------------------- /source/bin/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "running tests for S3helper and DynamoDBHelper." 3 | python3 test/test_helper.py 4 | echo "Running tests for datastore" 5 | python3 test/test_datastore.py -------------------------------------------------------------------------------- /source/bin/upload-samples.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | source .env 3 | aws s3 cp ./samples/ClassicMode/ s3://$SampleBucketName/public/samples/ --recursive 4 | if [ $ENABLE_KENDRA = "true" ] 5 | then 6 | aws s3 sync s3://$MedicalDataBucketName/documents/PersonaSpecific/GeneralPublic/policy/ s3://$BulkProcessingBucketName/kendraPolicyDrop/ 7 | aws s3 sync s3://$MedicalDataBucketName/documents/PersonaSpecific/HealthcareProvider/policy/ s3://$BulkProcessingBucketName/kendraPolicyDrop/ 8 | aws s3 sync s3://$MedicalDataBucketName/documents/PersonaSpecific/Scientist/policy/ s3://$BulkProcessingBucketName/kendraPolicyDrop/ 9 | aws s3 sync s3://$MedicalDataBucketName/documents/PersonaSpecific/GeneralPublic/pdf/ s3://$BulkProcessingBucketName/documentDrop/ 10 | aws s3 sync s3://$MedicalDataBucketName/documents/PersonaSpecific/HealthcareProvider/pdf/ s3://$BulkProcessingBucketName/documentDrop/ 11 | aws s3 sync s3://$MedicalDataBucketName/documents/PersonaSpecific/Scientist/pdf/ s3://$BulkProcessingBucketName/documentDrop/ 12 | aws s3 sync s3://$MedicalDataBucketName/documents/GeneralDocuments/pdf/ s3://$BulkProcessingBucketName/documentDrop/ 13 | fi 14 | 15 | 16 | -------------------------------------------------------------------------------- /source/cdk.json: -------------------------------------------------------------------------------- 1 | { 2 | "app": "node bin/deploy-backend.js" 3 | } -------------------------------------------------------------------------------- /source/lambda/boto3/requirements.txt: -------------------------------------------------------------------------------- 1 | docutils==0.20.1 2 | jmespath==1.0.1 3 | python_dateutil==2.8.2 4 | boto3==1.24.37 5 | botocore==1.27.37 6 | s3transfer==0.6.0 7 | six==1.16.0 8 | urllib3==1.26.18 9 | filetype==1.1.0 10 | -------------------------------------------------------------------------------- /source/lambda/elasticsearch/requirements.txt: -------------------------------------------------------------------------------- 1 | requests-aws4auth==0.9 2 | elasticsearch==7.9.1 3 | requests==2.31.0 4 | idna==3.3 5 | chardet==5.2.0 6 | certifi==2023.7.22 7 | urllib3==1.26.18 8 | 9 | -------------------------------------------------------------------------------- /source/lambda/joberrorhandler/lambda_function.py: -------------------------------------------------------------------------------- 1 | 2 | ###################################################################################################################### 3 | # Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. # 4 | # # 5 | # Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance # 6 | # with the License. A copy of the License is located at # 7 | # # 8 | # http://www.apache.org/licenses/LICENSE-2.0 # 9 | # # 10 | # or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES # 11 | # OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions # 12 | # and limitations under the License. # 13 | ##################################################################################################################### 14 | 15 | import os 16 | import json 17 | import boto3 18 | 19 | TABLE_NAME =os.environ['DOCUMENTS_TABLE'] 20 | dynamodb_client = boto3.client('dynamodb') 21 | 22 | 23 | def get_document_status(document_id): 24 | response = dynamodb_client.get_item(TableName=TABLE_NAME,Key={'documentId':{'S':str(document_id)}}) 25 | if response.get('Item') is not None: 26 | if response['Item'].get('documentStatus') is not None: 27 | return response['Item']['documentStatus'].get('S') 28 | 29 | def update_document_status_to_failed(document_id): 30 | dynamodb_client.update_item( 31 | TableName=TABLE_NAME, 32 | Key={'documentId': {'S': document_id}}, 33 | UpdateExpression="set documentStatus = :r", 34 | ExpressionAttributeValues={':r': {'S':'FAILED'}} 35 | ) 36 | 37 | def lambda_handler(event, context): 38 | for record in event['Records']: 39 | document_id = json.loads(record['body'])['documentId'] 40 | print("Processing doc : {}".format(document_id)) 41 | if get_document_status(document_id) != 'SUCCEEDED': 42 | print("Updating status for doc : {}".format(document_id)) 43 | update_document_status_to_failed(document_id) 44 | -------------------------------------------------------------------------------- /source/lambda/pdfgenerator/README.md: -------------------------------------------------------------------------------- 1 | # Searchable PDF Attribution 2 | 3 | This file is compiled from the following source: 4 | 5 | source: https://github.com/aws-samples/amazon-textract-searchable-pdf 6 | commit: bcba2c5f6c184dc37b05a17b019c6d13d9b0fdbf 7 | 8 | Compiled using the following command: 9 | 10 | `java -cp target/searchable-pdf-1.0.jar Demo` 11 | 12 | If you do not wish to use the provided jar binary, you can download the source code from the link provided, and compile it yourself. 13 | -------------------------------------------------------------------------------- /source/lambda/pdfgenerator/searchable-pdf-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/lambda/pdfgenerator/searchable-pdf-1.0.jar -------------------------------------------------------------------------------- /source/lib/cdk-textract-client-stack.ts: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | import { Construct, Stack, StackProps } from '@aws-cdk/core'; 15 | import s3 = require('@aws-cdk/aws-s3'); 16 | import s3deployment = require('@aws-cdk/aws-s3-deployment'); 17 | 18 | export class CdkTextractClientStack extends Stack { 19 | constructor(scope: Construct | undefined, id: string | undefined, props?: StackProps | undefined) { 20 | super(scope, id, props); 21 | 22 | const clientS3Bucket = '%%CLIENT_APP_BUCKET%%'; 23 | 24 | const resourceName = (name: string) => `${id}${name}`; 25 | 26 | const clientAppS3Bucket = s3.Bucket.fromBucketName(this, 'ClientAppBucket', clientS3Bucket); 27 | 28 | // eslint-disable-next-line no-unused-vars 29 | const clientAppS3BucketDeployment = new s3deployment.BucketDeployment( 30 | this, 31 | resourceName('DeployClientAppS3Bucket'), 32 | { 33 | sources: [s3deployment.Source.asset('app/out')], 34 | destinationBucket: clientAppS3Bucket, 35 | destinationKeyPrefix: '' 36 | } 37 | ); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /source/next.config.js: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************************** 2 | * Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * 3 | * * 4 | * Licensed under the Apache License, Version 2.0 (the License). You may not use this file except in compliance * 5 | * with the License. A copy of the License is located at * 6 | * * 7 | * http://www.apache.org/licenses/LICENSE-2.0 * 8 | * * 9 | * or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES * 10 | * OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions * 11 | * and limitations under the License. * 12 | *********************************************************************************************************************/ 13 | 14 | // Environment configs 15 | const { 16 | parsed: { 17 | APIGateway, 18 | FileBucketName: bucket, 19 | IdentityPoolId: identityPoolId, 20 | region, 21 | UserPoolClientId: userPoolWebClientId, 22 | UserPoolId: userPoolId, 23 | isROMode, 24 | }, 25 | } = require("dotenv").config(); 26 | 27 | // Configs passed to next.js 28 | module.exports = { 29 | publicRuntimeConfig: { 30 | APIGateway, 31 | bucket, 32 | identityPoolId, 33 | region, 34 | userPoolWebClientId, 35 | userPoolId, 36 | isROMode, 37 | }, 38 | }; 39 | -------------------------------------------------------------------------------- /source/samples/ClassicMode/Finance/Lacey city bonds.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Finance/Lacey city bonds.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Finance/Spokane accounting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Finance/Spokane accounting.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Finance/USDC balance sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Finance/USDC balance sheet.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Finance/USDE balance sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Finance/USDE balance sheet.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Medical/HIPAA Release Form.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Medical/HIPAA Release Form.pdf -------------------------------------------------------------------------------- /source/samples/ClassicMode/Medical/Medical History Form.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Medical/Medical History Form.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Medical/Medical Insurance Claim Form.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Medical/Medical Insurance Claim Form.pdf -------------------------------------------------------------------------------- /source/samples/ClassicMode/Medical/Medical Progress Tracker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Medical/Medical Progress Tracker.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Misc/employmentapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Misc/employmentapp.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Misc/expense.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Misc/expense.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Misc/management.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Misc/management.png -------------------------------------------------------------------------------- /source/samples/ClassicMode/Research/employmentapp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/ClassicMode/Research/employmentapp.png -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Causes_of_Chronic_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Causes_of_Chronic_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Chronic_Kidney_Disease_Tests_Diagnosis__NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Chronic_Kidney_Disease_Tests_Diagnosis__NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Diet_Eating_and_Physical_Activity_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Diet_Eating_and_Physical_Activity_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Gum_Disease_and_Other_Dental_Problems_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Gum_Disease_and_Other_Dental_Problems_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Heart_Disease_and_Stroke_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Heart_Disease_and_Stroke_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Tests_and_Diagnosis_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Diabetes_Tests_and_Diagnosis_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Eating_Right_for_Chronic_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Eating_Right_for_Chronic_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/High_Blood_Pressure_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/High_Blood_Pressure_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Identify_Evaluate_Patients_with_Chronic_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Identify_Evaluate_Patients_with_Chronic_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Insulin_Medicines_and_Other_Diabetes_Treatments_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Insulin_Medicines_and_Other_Diabetes_Treatments_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Kidney_Transplant_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Kidney_Transplant_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Managing_Chronic_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Managing_Chronic_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Managing_Diabetes_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Managing_Diabetes_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Nutrition_for_Advanced_Chronic_Kidney_Disease_in_Adults_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Nutrition_for_Advanced_Chronic_Kidney_Disease_in_Adults_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Pregnancy_if_You_Have_Diabetes_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Pregnancy_if_You_Have_Diabetes_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Preventing_Chronic_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Preventing_Chronic_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Preventing_Diabetes_Problems_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Preventing_Diabetes_Problems_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Preventing_Type_2_Diabetes_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/Preventing_Type_2_Diabetes_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/The_A1C_Test_Diabetes_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/The_A1C_Test_Diabetes_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/What_If_My_Kidneys_Fail_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/What_If_My_Kidneys_Fail_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/What_Is_Chronic_Kidney_Disease_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/What_Is_Chronic_Kidney_Disease_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/GeneralDocuments/pdf/What_is_Diabetes_NIDDK.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/GeneralDocuments/pdf/What_is_Diabetes_NIDDK.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/GeneralPublic/pdf/Creatine_Kinase_-_MedlinePlus_Medical_Test.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/PersonaSpecific/GeneralPublic/pdf/Creatine_Kinase_-_MedlinePlus_Medical_Test.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/GeneralPublic/policy/Creatine_Kinase_-_MedlinePlus_Medical_Test.pdf.metadata.json: -------------------------------------------------------------------------------- 1 | {"AccessControlList": [{"Access": "ALLOW", "Type": "GROUP", "Name": "generalpublic"}], "DocumentId": "Creatine_Kinase_-_MedlinePlus_Medical_Test", "Title": "Creatine Kinase - MedlinePlus Medical Test"} -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/HealthcareProvider/pdf/Muscular_Dystrophy_NIH.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/PersonaSpecific/HealthcareProvider/pdf/Muscular_Dystrophy_NIH.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/HealthcareProvider/pdf/What_is_Muscular_Dystrophy_-_CDC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/PersonaSpecific/HealthcareProvider/pdf/What_is_Muscular_Dystrophy_-_CDC.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/HealthcareProvider/policy/Muscular_Dystrophy_NIH.pdf.metadata.json: -------------------------------------------------------------------------------- 1 | {"AccessControlList": [{"Access": "ALLOW", "Type": "GROUP", "Name": "healthcareprovider"}], "DocumentId": "Muscular_Dystrophy_NIH", "Title": "Muscular Dystrophy Summary "} -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/HealthcareProvider/policy/What_is_Muscular_Dystrophy_-_CDC.pdf.metadata.json: -------------------------------------------------------------------------------- 1 | {"AccessControlList": [{"Access": "ALLOW", "Type": "GROUP", "Name": "healthcareprovider"}], "DocumentId": "What_is_Muscular_Dystrophy_-_CDC", "Title": "What is Muscular Dystrophy - CDC"} -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/pdf/How_is_muscular_dystrophy_diagnosed__NICHD.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/pdf/How_is_muscular_dystrophy_diagnosed__NICHD.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/pdf/Muscular_Dystrophy_Information_Page_National_Institute_of_Neurological_Disorders_and_Stroke.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/pdf/Muscular_Dystrophy_Information_Page_National_Institute_of_Neurological_Disorders_and_Stroke.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/pdf/Muscular_Dystrophy__Hope_Through_Research_-_National_Institute_Of_Neurological_Disorders_And_Stroke.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-solutions/document-understanding-solution/63ca358bc83d2c3dac95e6f97c096acfa748991c/source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/pdf/Muscular_Dystrophy__Hope_Through_Research_-_National_Institute_Of_Neurological_Disorders_And_Stroke.pdf -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/policy/How_is_muscular_dystrophy_diagnosed__NICHD.pdf.metadata.json: -------------------------------------------------------------------------------- 1 | {"AccessControlList": [{"Access": "ALLOW", "Type": "GROUP", "Name": "scientist"}], "DocumentId": "How_is_muscular_dystrophy_diagnosed__NICHD", "Title": "Muscular Dystrophy Diagnosis - The National Institute of Diabetes and Digestive and Kidney Diseases Health Information Center"} -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/policy/Muscular_Dystrophy_Hope_Through_Research_National_Institute_of_Neurological_Disorders_and_Stroke.pdf.metadata.json: -------------------------------------------------------------------------------- 1 | {"AccessControlList": [{"Access": "ALLOW", "Type": "GROUP", "Name": "scientist"}], "DocumentId": "Muscular_Dystrophy__Hope_Through_Research_-_National_Institute_Of_Neurological_Disorders_And_Stroke", "Title": "Muscular Dystrophy Hope Through Research - National Institute Of Neurological Disorders And Stroke"} -------------------------------------------------------------------------------- /source/samples/KendraPdfs/documents/PersonaSpecific/Scientist/policy/Muscular_Dystrophy_Information_Page_National_Institute_of_Neurological_Disorders_and_Stroke.pdf.metadata.json: -------------------------------------------------------------------------------- 1 | {"AccessControlList": [{"Access": "ALLOW", "Type": "GROUP", "Name": "scientist"}], "DocumentId": "Muscular_Dystrophy_Information_Page_National_Institute_of_Neurological_Disorders_and_Stroke", "Title": "Muscular Dystrophy Research Information Page - National Institute Of Neurological Disorders And Stroke"} -------------------------------------------------------------------------------- /source/samples/KendraPdfs/faqs/medical_faq.csv: -------------------------------------------------------------------------------- 1 | What is muscle dystrophy?,Muscular dystrophy is a group of diseases that cause progressive weakness and loss of muscle mass. 2 | What is diabetes?, Diabetes occurs when your blood glucose (also known as blood sugar) is too high. 3 | What are the types of diabetes?,The most common types of diabetes are type 1 type 2 and gestational diabetes. 4 | Does high blood pressure cause kidney disease?,High blood pressure is the second leading cause (after diabetes) and can also be a result of kidney disease. -------------------------------------------------------------------------------- /source/test-pre.js: -------------------------------------------------------------------------------- 1 | const { exec } = require("child_process"); 2 | const fs = require("fs"); 3 | const aws = require("aws-sdk"); 4 | const _ = require("lodash"); 5 | 6 | // const stackName = `${process.env.STACKNAME}Stack`; 7 | const region = process.env.AWS_REGION; 8 | aws.config.region = "us-west-2"; 9 | 10 | const stackName = "DUSStack"; 11 | 12 | const cloudformationDescribe = `aws cloudformation list-stack-resources --page-size 200 --region ${region} --stack-name ${stackName}`; 13 | 14 | // listStackResources needs to be called twice in order to get the full stack. 15 | const listFullStack = (stackName, callback) => { 16 | const cf = new aws.CloudFormation(); 17 | cf.listStackResources( 18 | { 19 | StackName: stackName 20 | }, 21 | (err, resp) => { 22 | console.log(resp); 23 | console.log(err); 24 | callback(err, resp); 25 | } 26 | ); 27 | }; 28 | console.log("sjklfhsjkld"); 29 | listFullStack(stackName, (err, resp) => console.log(resp)); 30 | --------------------------------------------------------------------------------