Skip to content

Commit 9b33855

Browse files
authored
Adding Conditional Request S3 scenario and actions (JavaScriptV3) (#7215)
1 parent 619d990 commit 9b33855

File tree

82 files changed

+1972
-63
lines changed

Some content is hidden

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

82 files changed

+1972
-63
lines changed

.doc_gen/metadata/s3_metadata.yaml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,18 @@ s3_CopyObject:
293293
- description: Copy the object.
294294
snippet_tags:
295295
- s3.JavaScript.buckets.copyObjectV3
296+
- description: Copy the object on condition its ETag does not match the one provided.
297+
snippet_files:
298+
- javascriptv3/example_code/s3/actions/copy-object-conditional-request-if-match.js
299+
- description: Copy the object on condition its ETag does not match the one provided.
300+
snippet_files:
301+
- javascriptv3/example_code/s3/actions/copy-object-conditional-request-if-none-match.js
302+
- description: Copy the object using on condition it has been created or modified in a given timeframe.
303+
snippet_files:
304+
- javascriptv3/example_code/s3/actions/copy-object-conditional-request-if-modified-since.js
305+
- description: Copy the object using on condition it has not been created or modified in a given timeframe.
306+
snippet_files:
307+
- javascriptv3/example_code/s3/actions/copy-object-conditional-request-if-unmodified-since.js
296308
PHP:
297309
versions:
298310
- sdk_version: 3
@@ -951,6 +963,18 @@ s3_GetObject:
951963
- description: Download the object.
952964
snippet_tags:
953965
- s3.JavaScript.buckets.getobjectV3
966+
- description: Download the object on condition its ETag does not match the one provided.
967+
snippet_files:
968+
- javascriptv3/example_code/s3/actions/get-object-conditional-request-if-match.js
969+
- description: Download the object on condition its ETag does not match the one provided.
970+
snippet_files:
971+
- javascriptv3/example_code/s3/actions/get-object-conditional-request-if-none-match.js
972+
- description: Download the object using on condition it has been created or modified in a given timeframe.
973+
snippet_files:
974+
- javascriptv3/example_code/s3/actions/get-object-conditional-request-if-modified-since.js
975+
- description: Download the object using on condition it has not been created or modified in a given timeframe.
976+
snippet_files:
977+
- javascriptv3/example_code/s3/actions/get-object-conditional-request-if-unmodified-since.js
954978
Ruby:
955979
versions:
956980
- sdk_version: 3
@@ -1602,6 +1626,9 @@ s3_PutObject:
16021626
- description: Upload the object.
16031627
snippet_tags:
16041628
- s3.JavaScript.buckets.uploadV3
1629+
- description: Upload the object on condition its ETag matches the one provided.
1630+
snippet_files:
1631+
- javascriptv3/example_code/s3/actions/get-object-conditional-request-if-match.js
16051632
Ruby:
16061633
versions:
16071634
- sdk_version: 3
@@ -3617,6 +3644,29 @@ s3_Scenario_ConditionalRequests:
36173644
- description: A wrapper class for S3 functions.
36183645
snippet_tags:
36193646
- S3ConditionalRequests.dotnetv3.S3ActionsWrapper
3647+
JavaScript:
3648+
versions:
3649+
- sdk_version: 3
3650+
github: javascriptv3/example_code/s3/scenarios/conditional-requests
3651+
sdkguide:
3652+
excerpts:
3653+
- description: |
3654+
Entrypoint for the workflow (<noloc>index.js</noloc>). This orchestrates all of the steps.
3655+
Visit GitHub to see the implementation details for Scenario, ScenarioInput, ScenarioOutput, and ScenarioAction.
3656+
snippet_files:
3657+
- javascriptv3/example_code/s3/scenarios/conditional-requests/index.js
3658+
- description: Output welcome messages to the console (<noloc>welcome.steps.js</noloc>).
3659+
snippet_files:
3660+
- javascriptv3/example_code/s3/scenarios/conditional-requests/welcome.steps.js
3661+
- description: Deploy buckets and objects (<noloc>setup.steps.js</noloc>).
3662+
snippet_files:
3663+
- javascriptv3/example_code/s3/scenarios/conditional-requests/setup.steps.js
3664+
- description: Get, copy, and put objects using S3 conditional requests (<noloc>repl.steps.js</noloc>).
3665+
snippet_files:
3666+
- javascriptv3/example_code/s3/scenarios/conditional-requests/repl.steps.js
3667+
- description: Destroy all created resources (<noloc>clean.steps.js</noloc>).
3668+
snippet_files:
3669+
- javascriptv3/example_code/s3/scenarios/conditional-requests/clean.steps.js
36203670
services:
36213671
s3: {GetObject, PutObject, CopyObject}
36223672
s3_Scenario_DownloadS3Directory:

javascriptv3/example_code/bedrock-agent-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "Apache-2.0",
66
"type": "module",
77
"scripts": {
8-
"test": "vitest run **/*.unit.test.js"
8+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/bedrock-agent-runtime-test-results.junit.xml"
99
},
1010
"dependencies": {
1111
"@aws-sdk/client-bedrock-agent-runtime": "^3.675.0"

javascriptv3/example_code/bedrock-agent/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"license": "Apache-2.0",
66
"type": "module",
77
"scripts": {
8-
"test": "vitest run **/*.unit.test.js",
9-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml"
8+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/bedrock-agent-test-results.junit.xml"
109
},
1110
"dependencies": {
1211
"@aws-sdk/client-bedrock-agent": "^3.515.0"

javascriptv3/example_code/bedrock-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "Apache-2.0",
66
"type": "module",
77
"scripts": {
8-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml"
8+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/bedrock-runtime-test-results.junit.xml"
99
},
1010
"devDependencies": {
1111
"vitest": "^1.6.0"

javascriptv3/example_code/bedrock/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "Apache-2.0",
66
"type": "module",
77
"scripts": {
8-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml"
8+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/bedrock-test-results.junit.xml"
99
},
1010
"dependencies": {
1111
"@aws-sdk/client-bedrock": "^3.485.0"

javascriptv3/example_code/cloudwatch-events/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"type": "module",
1313
"scripts": {
14-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml"
14+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/cloudwatchevents-test-results.junit.xml"
1515
},
1616
"devDependencies": {
1717
"vitest": "^1.6.0"

javascriptv3/example_code/cloudwatch-logs/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"@aws-sdk/client-lambda": "^3.216.0"
1212
},
1313
"scripts": {
14-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml",
15-
"test": "vitest run **/*.unit.test.js"
14+
"test": "vitest run unit",
15+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/cloudwatchlogs-test-results.junit.xml"
1616
},
1717
"devDependencies": {
1818
"vitest": "^1.6.0"

javascriptv3/example_code/cloudwatch/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"@aws-sdk/client-ec2": "^3.213.0"
1111
},
1212
"scripts": {
13-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml"
13+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/cloudwatch-test-results.junit.xml"
1414
},
1515
"devDependencies": {
1616
"uuid": "^9.0.0",

javascriptv3/example_code/codebuild/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
"type": "module",
1111
"scripts": {
12-
"integration-test": "vitest run **/*.integration.test.js --reporter=junit --outputFile=test_results/$npm_package_name.junit.xml"
12+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/codebuild-test-results.junit.xml"
1313
},
1414
"devDependencies": {
1515
"@aws-sdk/client-iam": "^3.391.0",

javascriptv3/example_code/codecommit/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"license": "Apache-2.0",
66
"type": "module",
77
"scripts": {
8-
"test": "vitest run **/*.unit.test.js"
8+
"test": "vitest run unit",
9+
"integration-test": "vitest run integration --reporter=junit --outputFile=test_results/codecommit-test-results.junit.xml"
910
},
1011
"dependencies": {
1112
"@aws-sdk/client-codecommit": "^3.427.0"

0 commit comments

Comments
 (0)