Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit edb631a

Browse files
authored
Upgrade to version v1.1.0
Upgrade to version v1.1.0
2 parents 292f7ff + dbef529 commit edb631a

File tree

217 files changed

+21410
-6330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

217 files changed

+21410
-6330
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
=======
99

10+
## [1.1.0] - 2024-07-03
11+
12+
### Updated
13+
14+
- Added OpenSearch support
15+
- Backend bulk documents upload
16+
- Pagination on loading cases page
17+
18+
### Security
19+
20+
- Updated node modules to patch vulnerabilities
21+
1022
## [1.0.12] - 2024-06-25
1123

1224
### Security

NOTICE.txt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ This software includes third party software subject to the following copyrights:
3333
@cloudscape-design/design-tokens Apache-2.0
3434
@cloudscape-design/global-styles Apache-2.0
3535
@cloudscape-design/jest-preset Apache-2.0
36+
@reduxjs/toolkit MIT
3637
@tanstack/react-table MIT
3738
@testing-library/jest-dom MIT
3839
@testing-library/react MIT
@@ -47,36 +48,36 @@ This software includes third party software subject to the following copyrights:
4748
@types/uuid MIT
4849
@typescript-eslint/eslint-plugin MIT
4950
@typescript-eslint/parser BSD-2-Clause
50-
attrs MIT
51+
attrs MIT
5152
aws-amplify Apache-2.0
5253
aws-cdk-lib Apache-2.0
5354
aws-lambda-powertools MIT
5455
aws-sdk Apache-2.0
5556
aws-sdk-client-mock MIT
5657
aws-sdk-mock Apache-2.0
5758
aws-xray-sdk Apache-2.0
58-
awscli Apache-2.0
59+
awscli Apache-2.0
5960
babel-jest MIT
6061
boolean.py BSD-2-Clause
6162
bootstrap MIT
6263
boto3 Apache-2.0
6364
botocore Apache-2.0
6465
cdk-nag Apache-2.0
65-
colorama BSD-3-Clause
66+
colorama BSD-3-Clause
6667
com.amazonaws>>aws-lambda-java-events Apache-2.0
6768
com.drewnoakes>>metadata-extractor Apache-2.0
6869
com.google.code.gson>>gson Apache-2.0
6970
constructs Apache-2.0
70-
coverage Apache-2.0
71+
coverage Apache-2.0
7172
dayjs MIT
7273
docutils BSD License
7374
eslint MIT
74-
exceptiongroup MIT
75+
exceptiongroup MIT
7576
freezegun Apache-2.0
7677
identity-obj-proxy MIT
77-
iniconfig MIT
78+
iniconfig MIT
7879
jest MIT
79-
jmespath MIT
80+
jmespath MIT
8081
jwt-decode MIT
8182
lodash MIT
8283
license-expression Apache-2.0
@@ -90,14 +91,14 @@ org.junit.jupiter>>junit-jupiter-engine EPL 2.0
9091
org.mockito>>mockito-inline MIT
9192
pdf-lib MIT
9293
pdfjs-dist Apache-2.0
93-
pluggy MIT
94+
pluggy MIT
9495
portfinder MIT
9596
prettier MIT
96-
pyasn1 BSD-2-Clause
97+
pyasn1 BSD-2-Clause
9798
pytest MIT
9899
pytest-cov MIT
99100
pytest-env MIT
100-
python-dateutil Apache-2.0
101+
python-dateutil Apache-2.0
101102
PyYAML MIT
102103
ramda MIT
103104
react MIT
@@ -107,8 +108,10 @@ react-pdf MIT
107108
react-router-dom MIT
108109
react-scripts MIT
109110
react-tabs MIT
110-
rsa Apache-2.0
111-
s3transfer Apache-2.0
111+
react-highlighter-ts MIT
112+
react-redux MIT
113+
rsa Apache-2.0
114+
s3transfer Apache-2.0
112115
setuptools MIT
113116
software.amazon.awssdk>>cloudwatch Apache-2.0
114117
software.amazon.awssdk>>s3 Apache-2.0
@@ -117,12 +120,12 @@ software.amazon.lambda>>powertools-logging Apache-2.0
117120
software.amazon.lambda>>powertools-tracing Apache-2.0
118121
source-map-support MIT
119122
testcontainers MIT
120-
tomli MIT
123+
tomli MIT
121124
ts-jest MIT
122125
ts-node MIT
123126
typescript Apache-2.0
124-
typing-extensions Python 2.0
127+
typing_extensions Python 2.0
125128
uk.org.webcompere>>system-stubs-core MIT
126129
uk.org.webcompere>>system-stubs-jupiter MIT
127130
uuid MIT
128-
wrapt BSD License
131+
wrapt BSD License

deployment/build-s3-dist.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ mkdir -p $template_dist_dir
6464
rm -rf $build_dist_dir
6565
mkdir -p $build_dist_dir
6666

67+
rm -rf $source_dir/infrastructure/cdk.out
68+
6769
echo "------------------------------------------------------------------------------"
6870
echo "[Init] Install dependencies for the cdk-solution-helper"
6971
echo "------------------------------------------------------------------------------"
@@ -75,7 +77,9 @@ echo "[Synth] CDK Project"
7577
echo "------------------------------------------------------------------------------"
7678
cd $source_dir/infrastructure
7779

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

8185
echo "------------------------------------------------------------------------------"

deployment/cdk-solution-helper/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
// Imports
15-
const fs = require("fs");
15+
const fs = require("node:fs");
1616

1717
// Paths
1818
const global_s3_assets = "../../deployment/global-s3-assets";

deployment/cdk-solution-helper/package-lock.json

Lines changed: 11 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
2-
"name": "cdk-solution-helper",
3-
"version": "0.1.0",
4-
"description": "This script performs token replacement as part of the build pipeline",
5-
"dependencies": {
6-
"fs": "^0.0.2"
7-
},
8-
"license": "Apache-2.0",
9-
"author": {
10-
"name": "Amazon Web Services",
11-
"url": "https://aws.amazon.com/solutions"
12-
}
13-
}
2+
"name": "cdk-solution-helper",
3+
"version": "0.1.0",
4+
"description": "This script performs token replacement as part of the build pipeline",
5+
"license": "Apache-2.0",
6+
"author": {
7+
"name": "Amazon Web Services",
8+
"url": "https://aws.amazon.com/solutions"
9+
}
10+
}

source/infrastructure/cdk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@aws-cdk/aws-codepipeline-actions:useNewDefaultBranchForCodeCommitSource": true,
5858
"solution_id": "SO0281",
5959
"solution_name": "enhanced-document-understanding-on-aws",
60-
"solution_version": "v1.0.11",
60+
"solution_version": "v1.1.0",
6161
"app_namespace": "app.idp",
6262
"app_registry_name": "enhanced-document-understanding",
6363
"application_type": "AWS-Solutions",

source/infrastructure/lib/api/case-manager.ts

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ export interface CaseManagerProps {
5555
* The table which contains the configuration for workflows
5656
*/
5757
workflowConfigTable: dynamodb.Table;
58+
59+
60+
/**
61+
* The ARN for the Event Bus
62+
*/
63+
eventBusArn: string;
5864
}
5965

6066
/**
@@ -96,6 +102,31 @@ export class CaseManager extends Construct {
96102
constructor(scope: Construct, id: string, props: CaseManagerProps) {
97103
super(scope, id);
98104

105+
const appNamespace = cdk.Fn.findInMap('Solution', 'Data', 'AppNamespace');
106+
const userIdIndexProps: dynamodb.GlobalSecondaryIndexProps = {
107+
indexName: 'UserIdIndex',
108+
partitionKey: {
109+
name: 'USER_ID',
110+
type: dynamodb.AttributeType.STRING
111+
},
112+
projectionType: dynamodb.ProjectionType.ALL,
113+
sortKey: {
114+
name: 'CASE_ID',
115+
type: dynamodb.AttributeType.STRING
116+
}
117+
};
118+
const userDocIdIndexProps: dynamodb.GlobalSecondaryIndexProps = {
119+
indexName: 'UserDocIdIndex',
120+
partitionKey: {
121+
name: 'USER_DOC_ID',
122+
type: dynamodb.AttributeType.STRING
123+
},
124+
projectionType: dynamodb.ProjectionType.ALL,
125+
sortKey: {
126+
name: 'CASE_NAME',
127+
type: dynamodb.AttributeType.STRING
128+
}
129+
};
99130
const createRecordsLambdaToDynamoDb = new LambdaToDynamoDB(this, 'CreateRecordsLambdaDDb', {
100131
lambdaFunctionProps: {
101132
runtime: COMMERCIAL_REGION_LAMBDA_NODE_RUNTIME,
@@ -110,7 +141,11 @@ export class CaseManager extends Construct {
110141
UPLOAD_DOCS_BUCKET_NAME: props.bucketToUpload.bucketName,
111142
S3_UPLOAD_PREFIX: this.s3UploadPrefix,
112143
UUID: props.genUUID,
113-
WORKFLOW_CONFIG_NAME: props.workflowConfigName
144+
WORKFLOW_CONFIG_NAME: props.workflowConfigName,
145+
APP_NAMESPACE: appNamespace,
146+
EVENT_BUS_ARN: props.eventBusArn,
147+
DDB_GSI_USER_ID: userIdIndexProps.indexName,
148+
DDB_GSI_USER_DOC_ID: userDocIdIndexProps.indexName
114149
},
115150
timeout: cdk.Duration.minutes(10)
116151
},
@@ -136,19 +171,8 @@ export class CaseManager extends Construct {
136171
tableEnvironmentVariableName: 'WORKFLOW_CONFIG_TABLE_NAME'
137172
});
138173

139-
const globalSecondaryIndexProps: dynamodb.GlobalSecondaryIndexProps = {
140-
indexName: 'UserIdIndex',
141-
partitionKey: {
142-
name: 'USER_ID',
143-
type: dynamodb.AttributeType.STRING
144-
},
145-
projectionType: dynamodb.ProjectionType.ALL,
146-
sortKey: {
147-
name: 'CASE_ID',
148-
type: dynamodb.AttributeType.STRING
149-
}
150-
};
151-
createRecordsLambdaToDynamoDb.dynamoTable.addGlobalSecondaryIndex(globalSecondaryIndexProps);
174+
createRecordsLambdaToDynamoDb.dynamoTable.addGlobalSecondaryIndex(userIdIndexProps);
175+
createRecordsLambdaToDynamoDb.dynamoTable.addGlobalSecondaryIndex(userDocIdIndexProps);
152176

153177
this.docUploadLambda = createRecordsLambdaToDynamoDb.lambdaFunction;
154178
this.table = createRecordsLambdaToDynamoDb.dynamoTable;
@@ -169,7 +193,8 @@ export class CaseManager extends Construct {
169193
memorySize: 192,
170194
timeout: cdk.Duration.minutes(LAMBDA_TIMEOUT_MINS),
171195
environment: {
172-
DDB_GSI_USER_ID: globalSecondaryIndexProps.indexName,
196+
DDB_GSI_USER_ID: userIdIndexProps.indexName,
197+
DDB_GSI_USER_DOC_ID: userDocIdIndexProps.indexName,
173198
S3_REDACTED_PREFIX: S3_REDACTED_PREFIX
174199
}
175200
},

source/infrastructure/lib/api/model-schema/create-case-body.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,32 @@
1313

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

16+
export const caseBodySchema: JsonSchema = {
17+
type: JsonSchemaType.OBJECT,
18+
properties: {
19+
caseId: {
20+
type: JsonSchemaType.STRING,
21+
description: 'The ID of the case to whom the document belongs',
22+
pattern: '\\w+'
23+
}
24+
},
25+
required: ['caseId']
26+
}
27+
1628
export const createCaseBodySchema: JsonSchema = {
1729
type: JsonSchemaType.OBJECT,
1830
properties: {
1931
caseName: {
2032
type: JsonSchemaType.STRING,
2133
description: 'The ID of the case to whom the document belongs',
22-
pattern: '\\w+'
34+
pattern: '\\w+',
35+
minLength: 3,
36+
maxLength: 50
37+
},
38+
enableBackendUpload: {
39+
type: JsonSchemaType.BOOLEAN,
40+
description: 'Enables bulk uplod process'
2341
}
2442
},
25-
required: ['caseName']
43+
required: ['caseName', 'enableBackendUpload']
2644
};

source/infrastructure/lib/api/model-schema/upload-document-body.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,16 @@ export const uploadDocumentBodySchema: JsonSchema = {
2929
caseName: {
3030
type: JsonSchemaType.STRING,
3131
description: 'The ID of the case to whom the document belongs',
32-
pattern: '\\w+'
32+
pattern: '\\w+',
33+
minLength: 3,
34+
maxLength: 50
3335
},
3436
fileName: {
3537
type: JsonSchemaType.STRING,
3638
description: 'The name of the file',
37-
pattern: '\\w+'
39+
pattern: '\\w+',
40+
minLength: 3,
41+
maxLength: 50
3842
},
3943
fileExtension: {
4044
type: JsonSchemaType.STRING,
@@ -45,11 +49,7 @@ export const uploadDocumentBodySchema: JsonSchema = {
4549
type: JsonSchemaType.STRING,
4650
description: 'The type of document based on business rules, such as driving license, passport, etc',
4751
pattern: '\\w+'
48-
},
49-
tagging: {
50-
type: JsonSchemaType.STRING,
51-
description: 'Tags associated with the document'
5252
}
5353
},
54-
required: ['userId', 'caseId', 'caseName', 'fileName', 'fileExtension', 'documentType', 'tagging']
54+
required: ['userId', 'caseId', 'caseName', 'fileName', 'fileExtension', 'documentType']
5555
};

0 commit comments

Comments
 (0)