Skip to content

Commit

Permalink
Upgrade to version v1.1.0
Browse files Browse the repository at this point in the history
Upgrade to version v1.1.0
  • Loading branch information
ihmaws authored Jul 3, 2024
2 parents 48acc7b + edb631a commit 4997aac
Show file tree
Hide file tree
Showing 217 changed files with 21,410 additions and 6,330 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

=======

## [1.1.0] - 2024-07-03

### Updated

- Added OpenSearch support
- Backend bulk documents upload
- Pagination on loading cases page

### Security

- Updated node modules to patch vulnerabilities

## [1.0.12] - 2024-06-25

### Security
Expand Down
33 changes: 18 additions & 15 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This software includes third party software subject to the following copyrights:
@cloudscape-design/design-tokens Apache-2.0
@cloudscape-design/global-styles Apache-2.0
@cloudscape-design/jest-preset Apache-2.0
@reduxjs/toolkit MIT
@tanstack/react-table MIT
@testing-library/jest-dom MIT
@testing-library/react MIT
Expand All @@ -47,36 +48,36 @@ This software includes third party software subject to the following copyrights:
@types/uuid MIT
@typescript-eslint/eslint-plugin MIT
@typescript-eslint/parser BSD-2-Clause
attrs MIT
attrs MIT
aws-amplify Apache-2.0
aws-cdk-lib Apache-2.0
aws-lambda-powertools MIT
aws-sdk Apache-2.0
aws-sdk-client-mock MIT
aws-sdk-mock Apache-2.0
aws-xray-sdk Apache-2.0
awscli Apache-2.0
awscli Apache-2.0
babel-jest MIT
boolean.py BSD-2-Clause
bootstrap MIT
boto3 Apache-2.0
botocore Apache-2.0
cdk-nag Apache-2.0
colorama BSD-3-Clause
colorama BSD-3-Clause
com.amazonaws>>aws-lambda-java-events Apache-2.0
com.drewnoakes>>metadata-extractor Apache-2.0
com.google.code.gson>>gson Apache-2.0
constructs Apache-2.0
coverage Apache-2.0
coverage Apache-2.0
dayjs MIT
docutils BSD License
eslint MIT
exceptiongroup MIT
exceptiongroup MIT
freezegun Apache-2.0
identity-obj-proxy MIT
iniconfig MIT
iniconfig MIT
jest MIT
jmespath MIT
jmespath MIT
jwt-decode MIT
lodash MIT
license-expression Apache-2.0
Expand All @@ -90,14 +91,14 @@ org.junit.jupiter>>junit-jupiter-engine EPL 2.0
org.mockito>>mockito-inline MIT
pdf-lib MIT
pdfjs-dist Apache-2.0
pluggy MIT
pluggy MIT
portfinder MIT
prettier MIT
pyasn1 BSD-2-Clause
pyasn1 BSD-2-Clause
pytest MIT
pytest-cov MIT
pytest-env MIT
python-dateutil Apache-2.0
python-dateutil Apache-2.0
PyYAML MIT
ramda MIT
react MIT
Expand All @@ -107,8 +108,10 @@ react-pdf MIT
react-router-dom MIT
react-scripts MIT
react-tabs MIT
rsa Apache-2.0
s3transfer Apache-2.0
react-highlighter-ts MIT
react-redux MIT
rsa Apache-2.0
s3transfer Apache-2.0
setuptools MIT
software.amazon.awssdk>>cloudwatch Apache-2.0
software.amazon.awssdk>>s3 Apache-2.0
Expand All @@ -117,12 +120,12 @@ software.amazon.lambda>>powertools-logging Apache-2.0
software.amazon.lambda>>powertools-tracing Apache-2.0
source-map-support MIT
testcontainers MIT
tomli MIT
tomli MIT
ts-jest MIT
ts-node MIT
typescript Apache-2.0
typing-extensions Python 2.0
typing_extensions Python 2.0
uk.org.webcompere>>system-stubs-core MIT
uk.org.webcompere>>system-stubs-jupiter MIT
uuid MIT
wrapt BSD License
wrapt BSD License
4 changes: 4 additions & 0 deletions deployment/build-s3-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ mkdir -p $template_dist_dir
rm -rf $build_dist_dir
mkdir -p $build_dist_dir

rm -rf $source_dir/infrastructure/cdk.out

echo "------------------------------------------------------------------------------"
echo "[Init] Install dependencies for the cdk-solution-helper"
echo "------------------------------------------------------------------------------"
Expand All @@ -75,7 +77,9 @@ echo "[Synth] CDK Project"
echo "------------------------------------------------------------------------------"
cd $source_dir/infrastructure

npm install
# Important: CDK global version number
npm i
cdk_version=$(node ../../deployment/get-cdk-version.js) # Note: grabs from node_modules/aws-cdk-lib/package.json

echo "------------------------------------------------------------------------------"
Expand Down
2 changes: 1 addition & 1 deletion deployment/cdk-solution-helper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/

// Imports
const fs = require("fs");
const fs = require("node:fs");

// Paths
const global_s3_assets = "../../deployment/global-s3-assets";
Expand Down
37 changes: 11 additions & 26 deletions deployment/cdk-solution-helper/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 9 additions & 12 deletions deployment/cdk-solution-helper/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
{
"name": "cdk-solution-helper",
"version": "0.1.0",
"description": "This script performs token replacement as part of the build pipeline",
"dependencies": {
"fs": "^0.0.2"
},
"license": "Apache-2.0",
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com/solutions"
}
}
"name": "cdk-solution-helper",
"version": "0.1.0",
"description": "This script performs token replacement as part of the build pipeline",
"license": "Apache-2.0",
"author": {
"name": "Amazon Web Services",
"url": "https://aws.amazon.com/solutions"
}
}
2 changes: 1 addition & 1 deletion source/infrastructure/cdk.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
"solution_id": "SO0281",
"solution_name": "enhanced-document-understanding-on-aws",
"solution_version": "v1.0.11",
"solution_version": "v1.1.0",
"app_namespace": "app.idp",
"app_registry_name": "enhanced-document-understanding",
"application_type": "AWS-Solutions",
Expand Down
55 changes: 40 additions & 15 deletions source/infrastructure/lib/api/case-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ export interface CaseManagerProps {
* The table which contains the configuration for workflows
*/
workflowConfigTable: dynamodb.Table;


/**
* The ARN for the Event Bus
*/
eventBusArn: string;
}

/**
Expand Down Expand Up @@ -96,6 +102,31 @@ export class CaseManager extends Construct {
constructor(scope: Construct, id: string, props: CaseManagerProps) {
super(scope, id);

const appNamespace = cdk.Fn.findInMap('Solution', 'Data', 'AppNamespace');
const userIdIndexProps: dynamodb.GlobalSecondaryIndexProps = {
indexName: 'UserIdIndex',
partitionKey: {
name: 'USER_ID',
type: dynamodb.AttributeType.STRING
},
projectionType: dynamodb.ProjectionType.ALL,
sortKey: {
name: 'CASE_ID',
type: dynamodb.AttributeType.STRING
}
};
const userDocIdIndexProps: dynamodb.GlobalSecondaryIndexProps = {
indexName: 'UserDocIdIndex',
partitionKey: {
name: 'USER_DOC_ID',
type: dynamodb.AttributeType.STRING
},
projectionType: dynamodb.ProjectionType.ALL,
sortKey: {
name: 'CASE_NAME',
type: dynamodb.AttributeType.STRING
}
};
const createRecordsLambdaToDynamoDb = new LambdaToDynamoDB(this, 'CreateRecordsLambdaDDb', {
lambdaFunctionProps: {
runtime: COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME,
Expand All @@ -110,7 +141,11 @@ export class CaseManager extends Construct {
UPLOAD_DOCS_BUCKET_NAME: props.bucketToUpload.bucketName,
S3_UPLOAD_PREFIX: this.s3UploadPrefix,
UUID: props.genUUID,
WORKFLOW_CONFIG_NAME: props.workflowConfigName
WORKFLOW_CONFIG_NAME: props.workflowConfigName,
APP_NAMESPACE: appNamespace,
EVENT_BUS_ARN: props.eventBusArn,
DDB_GSI_USER_ID: userIdIndexProps.indexName,
DDB_GSI_USER_DOC_ID: userDocIdIndexProps.indexName
},
timeout: cdk.Duration.minutes(10)
},
Expand All @@ -136,19 +171,8 @@ export class CaseManager extends Construct {
tableEnvironmentVariableName: 'WORKFLOW_CONFIG_TABLE_NAME'
});

const globalSecondaryIndexProps: dynamodb.GlobalSecondaryIndexProps = {
indexName: 'UserIdIndex',
partitionKey: {
name: 'USER_ID',
type: dynamodb.AttributeType.STRING
},
projectionType: dynamodb.ProjectionType.ALL,
sortKey: {
name: 'CASE_ID',
type: dynamodb.AttributeType.STRING
}
};
createRecordsLambdaToDynamoDb.dynamoTable.addGlobalSecondaryIndex(globalSecondaryIndexProps);
createRecordsLambdaToDynamoDb.dynamoTable.addGlobalSecondaryIndex(userIdIndexProps);
createRecordsLambdaToDynamoDb.dynamoTable.addGlobalSecondaryIndex(userDocIdIndexProps);

this.docUploadLambda = createRecordsLambdaToDynamoDb.lambdaFunction;
this.table = createRecordsLambdaToDynamoDb.dynamoTable;
Expand All @@ -169,7 +193,8 @@ export class CaseManager extends Construct {
memorySize: 192,
timeout: cdk.Duration.minutes(LAMBDA_TIMEOUT_MINS),
environment: {
DDB_GSI_USER_ID: globalSecondaryIndexProps.indexName,
DDB_GSI_USER_ID: userIdIndexProps.indexName,
DDB_GSI_USER_DOC_ID: userDocIdIndexProps.indexName,
S3_REDACTED_PREFIX: S3_REDACTED_PREFIX
}
},
Expand Down
22 changes: 20 additions & 2 deletions source/infrastructure/lib/api/model-schema/create-case-body.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,32 @@

import { JsonSchema, JsonSchemaType } from 'aws-cdk-lib/aws-apigateway';

export const caseBodySchema: JsonSchema = {
type: JsonSchemaType.OBJECT,
properties: {
caseId: {
type: JsonSchemaType.STRING,
description: 'The ID of the case to whom the document belongs',
pattern: '\\w+'
}
},
required: ['caseId']
}

export const createCaseBodySchema: JsonSchema = {
type: JsonSchemaType.OBJECT,
properties: {
caseName: {
type: JsonSchemaType.STRING,
description: 'The ID of the case to whom the document belongs',
pattern: '\\w+'
pattern: '\\w+',
minLength: 3,
maxLength: 50
},
enableBackendUpload: {
type: JsonSchemaType.BOOLEAN,
description: 'Enables bulk uplod process'
}
},
required: ['caseName']
required: ['caseName', 'enableBackendUpload']
};
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ export const uploadDocumentBodySchema: JsonSchema = {
caseName: {
type: JsonSchemaType.STRING,
description: 'The ID of the case to whom the document belongs',
pattern: '\\w+'
pattern: '\\w+',
minLength: 3,
maxLength: 50
},
fileName: {
type: JsonSchemaType.STRING,
description: 'The name of the file',
pattern: '\\w+'
pattern: '\\w+',
minLength: 3,
maxLength: 50
},
fileExtension: {
type: JsonSchemaType.STRING,
Expand All @@ -45,11 +49,7 @@ export const uploadDocumentBodySchema: JsonSchema = {
type: JsonSchemaType.STRING,
description: 'The type of document based on business rules, such as driving license, passport, etc',
pattern: '\\w+'
},
tagging: {
type: JsonSchemaType.STRING,
description: 'Tags associated with the document'
}
},
required: ['userId', 'caseId', 'caseName', 'fileName', 'fileExtension', 'documentType', 'tagging']
required: ['userId', 'caseId', 'caseName', 'fileName', 'fileExtension', 'documentType']
};
Loading

0 comments on commit 4997aac

Please sign in to comment.