├── .husky ├── .gitignore └── pre-commit ├── .yarnrc.yml ├── packages ├── react-native │ ├── .watchmanconfig │ ├── _bundle │ │ └── config │ ├── app.json │ ├── .prettierrc.js │ ├── android │ │ ├── app │ │ │ ├── src │ │ │ │ └── main │ │ │ │ │ ├── res │ │ │ │ │ ├── values │ │ │ │ │ │ ├── strings.xml │ │ │ │ │ │ └── styles.xml │ │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ │ ├── ic_launcher.png │ │ │ │ │ │ └── ic_launcher_round.png │ │ │ │ │ └── drawable │ │ │ │ │ │ └── rn_edit_text_material.xml │ │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── reactnative │ │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ │ └── MainApplication.kt │ │ │ │ │ └── AndroidManifest.xml │ │ │ ├── debug.keystore │ │ │ ├── proguard-rules.pro │ │ │ └── build.gradle │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ ├── gradle-wrapper.jar │ │ │ │ └── gradle-wrapper.properties │ │ ├── settings.gradle │ │ ├── build.gradle │ │ ├── gradle.properties │ │ ├── gradlew.bat │ │ └── gradlew │ ├── ios │ │ ├── reactnative │ │ │ ├── Images.xcassets │ │ │ │ ├── Contents.json │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ └── Contents.json │ │ │ ├── PrivacyInfo.xcprivacy │ │ │ ├── Info.plist │ │ │ └── LaunchScreen.storyboard │ │ ├── reactnative.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ ├── .xcode.env │ │ ├── PrivacyInfo.xcprivacy │ │ ├── Podfile │ │ ├── AppDelegate.swift │ │ ├── reactnative.xcodeproj │ │ │ ├── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ │ └── reactnative.xcscheme │ │ │ └── project.pbxproj │ │ └── Podfile.lock │ ├── babel.config.js │ ├── index.js │ ├── Gemfile │ ├── metro.config.js │ ├── .gitignore │ ├── package.json │ ├── App.js │ └── Gemfile.lock ├── utils │ ├── src │ │ ├── index.js │ │ ├── config.js │ │ └── utils.js │ └── package.json ├── node │ ├── src │ │ └── index.js │ └── package.json └── web │ ├── index.html │ ├── package.json │ └── src │ └── index.js ├── .github ├── CODEOWNERS ├── renovate.json ├── PULL_REQUEST_TEMPLATE.md └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── img ├── screenshot-ios.png ├── screenshot-web.png ├── screenshot-node.png └── screenshot-android.png ├── .vscode ├── settings.json └── extensions.json ├── CODE_OF_CONDUCT.md ├── LICENSE ├── package.json ├── README.md ├── CONTRIBUTING.md └── .gitignore /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | nodeLinker: node-modules 2 | -------------------------------------------------------------------------------- /packages/react-native/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @aws-samples/aws-sdk-js-team 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /packages/utils/src/index.js: -------------------------------------------------------------------------------- 1 | export * from "./config.js"; 2 | export * from "./utils.js"; 3 | -------------------------------------------------------------------------------- /packages/react-native/_bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /img/screenshot-ios.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/img/screenshot-ios.png -------------------------------------------------------------------------------- /img/screenshot-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/img/screenshot-web.png -------------------------------------------------------------------------------- /packages/react-native/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "reactnative", 3 | "displayName": "reactnative" 4 | } 5 | -------------------------------------------------------------------------------- /img/screenshot-node.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/img/screenshot-node.png -------------------------------------------------------------------------------- /img/screenshot-android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/img/screenshot-android.png -------------------------------------------------------------------------------- /packages/utils/src/config.js: -------------------------------------------------------------------------------- 1 | export const REGION = "REGION"; 2 | export const IDENTITY_POOL_ID = "IDENTITY_POOL_ID"; 3 | -------------------------------------------------------------------------------- /packages/react-native/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | singleQuote: true, 4 | trailingComma: 'all', 5 | }; 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "editor.tabSize": 2, 3 | "editor.formatOnSave": true, 4 | "editor.defaultFormatter": "esbenp.prettier-vscode" 5 | } 6 | -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | reactnative 3 | 4 | -------------------------------------------------------------------------------- /packages/react-native/ios/reactnative/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "version": 1, 4 | "author": "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /packages/react-native/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/debug.keystore -------------------------------------------------------------------------------- /packages/react-native/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /packages/react-native/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:@react-native/babel-preset'], 3 | plugins: ['module:@babel/plugin-transform-class-static-block'], 4 | }; 5 | -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aws-samples/aws-sdk-js-tests/HEAD/packages/react-native/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /packages/react-native/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /packages/node/src/index.js: -------------------------------------------------------------------------------- 1 | import { REGION, getResponse } from "@aws-sdk/test-utils"; 2 | 3 | (async () => { 4 | let response; 5 | 6 | response = await getResponse({ region: REGION }); 7 | console.log("\nData returned:"); 8 | console.log(JSON.stringify(response, null, 2)); 9 | })(); 10 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | 3 | This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). 4 | For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact 5 | opensource-codeofconduct@amazon.com with any additional questions or comments. 6 | -------------------------------------------------------------------------------- /packages/react-native/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /packages/react-native/ios/reactnative.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /packages/react-native/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") } 2 | plugins { id("com.facebook.react.settings") } 3 | extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() } 4 | rootProject.name = 'reactnative' 5 | include ':app' 6 | includeBuild('../node_modules/@react-native/gradle-plugin') 7 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": ["config:base", ":dependencyDashboard"], 4 | "packageRules": [ 5 | { 6 | "matchPackagePatterns": ["*"], 7 | "enabled": false 8 | } 9 | ], 10 | "vulnerabilityAlerts": { 11 | "enabled": true 12 | }, 13 | "lockFileMaintenance": { 14 | "enabled": true, 15 | "schedule": ["before 3am on the first day of the month"] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Issue 2 | 3 | Issue number, if available, prefixed with "#" 4 | 5 | ### Description 6 | 7 | What does this implement/fix? Explain your changes. 8 | 9 | ### Testing 10 | 11 | How was this change tested? 12 | 13 | ### Additional context 14 | 15 | Add any other context about the PR here. 16 | 17 | --- 18 | 19 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. 20 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. 3 | // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp 4 | 5 | // List of extensions which should be recommended for users of this workspace. 6 | "recommendations": ["esbenp.prettier-vscode"], 7 | // List of extensions recommended by VS Code that should not be recommended for users of this workspace. 8 | "unwantedRecommendations": [] 9 | } 10 | -------------------------------------------------------------------------------- /packages/react-native/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /packages/react-native/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /packages/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Testing AWS SDK for JavaScript 7 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/react-native/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '3.3.4' 5 | 6 | # Exclude problematic versions of cocoapods and activesupport that causes build failures. 7 | gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1' 8 | gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0' 9 | gem 'xcodeproj', '< 1.26.0' 10 | gem 'concurrent-ruby', '< 1.3.4' 11 | 12 | # Ruby 3.4.0 has removed some libraries from the standard library. 13 | gem 'bigdecimal' 14 | gem 'logger' 15 | gem 'benchmark' 16 | gem 'mutex_m' -------------------------------------------------------------------------------- /packages/react-native/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext { 3 | buildToolsVersion = "36.0.0" 4 | minSdkVersion = 24 5 | compileSdkVersion = 36 6 | targetSdkVersion = 36 7 | ndkVersion = "27.1.12297006" 8 | kotlinVersion = "2.1.20" 9 | } 10 | repositories { 11 | google() 12 | mavenCentral() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle") 16 | classpath("com.facebook.react:react-native-gradle-plugin") 17 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin") 18 | } 19 | } 20 | 21 | apply plugin: "com.facebook.react.rootproject" 22 | -------------------------------------------------------------------------------- /packages/utils/src/utils.js: -------------------------------------------------------------------------------- 1 | import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity"; 2 | import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; 3 | import { DynamoDB } from "@aws-sdk/client-dynamodb"; 4 | 5 | import { REGION, IDENTITY_POOL_ID } from "./config.js"; 6 | 7 | export const getResponse = async (clientParams) => { 8 | const client = new DynamoDB(clientParams); 9 | return client.listTables({ Limit: 1 }); 10 | }; 11 | 12 | export const getBrowserResponse = async () => 13 | getResponse({ 14 | region: REGION, 15 | credentials: fromCognitoIdentityPool({ 16 | client: new CognitoIdentityClient({ 17 | region: REGION, 18 | }), 19 | identityPoolId: IDENTITY_POOL_ID, 20 | }), 21 | }); 22 | -------------------------------------------------------------------------------- /packages/web/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aws-sdk/test-web", 3 | "version": "1.0.0", 4 | "description": "Code samples to test AWS SDK for JavaScript in web environment", 5 | "private": true, 6 | "main": "src/index.js", 7 | "scripts": { 8 | "start:web": "vite --open" 9 | }, 10 | "dependencies": { 11 | "@aws-sdk/test-utils": "workspace:*" 12 | }, 13 | "author": { 14 | "name": "AWS SDK for JavaScript Team", 15 | "url": "https://aws.amazon.com/javascript/" 16 | }, 17 | "license": "MIT-0", 18 | "homepage": "https://github.com/aws-samples/aws-sdk-js-tests/tree/main/packages/web", 19 | "repository": { 20 | "type": "git", 21 | "url": "https://github.com/aws-samples/aws-sdk-js-tests.git", 22 | "directory": "packages/web" 23 | }, 24 | "devDependencies": { 25 | "vite": "^7.1.11" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/utils/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aws-sdk/test-utils", 3 | "version": "1.0.0", 4 | "description": "Utils for testing AWS SDK for JavaScript", 5 | "private": true, 6 | "main": "src/index.js", 7 | "dependencies": { 8 | "@aws-sdk/client-cognito-identity": "^3.540.0", 9 | "@aws-sdk/client-dynamodb": "^3.540.0", 10 | "@aws-sdk/credential-provider-cognito-identity": "^3.540.0" 11 | }, 12 | "author": { 13 | "name": "AWS SDK for JavaScript Team", 14 | "url": "https://aws.amazon.com/javascript/" 15 | }, 16 | "license": "MIT-0", 17 | "homepage": "https://github.com/aws-samples/aws-sdk-js-tests/tree/main/packages/utils", 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/aws-samples/aws-sdk-js-tests.git", 21 | "directory": "packages/utils" 22 | }, 23 | "type": "module" 24 | } 25 | -------------------------------------------------------------------------------- /packages/web/src/index.js: -------------------------------------------------------------------------------- 1 | import { getBrowserResponse } from "@aws-sdk/test-utils"; 2 | 3 | const getHTMLElement = (title, content) => { 4 | const element = document.createElement("div"); 5 | element.style.margin = "30px"; 6 | 7 | const titleDiv = document.createElement("div"); 8 | titleDiv.innerHTML = title; 9 | const contentDiv = document.createElement("textarea"); 10 | contentDiv.rows = 20; 11 | contentDiv.cols = 50; 12 | contentDiv.innerHTML = content; 13 | 14 | element.appendChild(titleDiv); 15 | element.appendChild(contentDiv); 16 | 17 | return element; 18 | }; 19 | 20 | const component = async () => { 21 | const response = await getBrowserResponse(); 22 | return getHTMLElement("Data returned:", JSON.stringify(response, null, 2)); 23 | }; 24 | 25 | (async () => { 26 | document.body.appendChild(await component()); 27 | })(); 28 | -------------------------------------------------------------------------------- /packages/node/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aws-sdk/test-node", 3 | "version": "1.0.0", 4 | "description": "Code samples to test AWS SDK for JavaScript in Node.js environment", 5 | "private": true, 6 | "main": "src/index.js", 7 | "scripts": { 8 | "start:node": "nodemon src/index.js" 9 | }, 10 | "dependencies": { 11 | "@aws-sdk/test-utils": "workspace:*" 12 | }, 13 | "devDependencies": { 14 | "nodemon": "^2.0.19" 15 | }, 16 | "author": { 17 | "name": "AWS SDK for JavaScript Team", 18 | "url": "https://aws.amazon.com/javascript/" 19 | }, 20 | "license": "MIT-0", 21 | "homepage": "https://github.com/aws-samples/aws-sdk-js-tests/tree/main/packages/node", 22 | "repository": { 23 | "type": "git", 24 | "url": "https://github.com/aws-samples/aws-sdk-js-tests.git", 25 | "directory": "packages/node" 26 | }, 27 | "type": "module" 28 | } 29 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | 14 | 15 | ## Describe the bug 16 | 17 | A clear and concise description of what the bug is. 18 | 19 | ## Steps to reproduce 20 | 21 | Steps to reproduce the behavior. 22 | 23 | #### Observed behavior 24 | 25 | A clear and concise description of what happens. 26 | 27 | #### Expected behavior 28 | 29 | A clear and concise description of what you were expecting to happen. 30 | 31 | #### Screenshots 32 | 33 | If applicable, add screenshots to help explain your problem. 34 | 35 | ## Additional context 36 | 37 | Add any other context about the problem here. 38 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | 14 | 15 | ### Is your feature request related to a problem? Please describe. 16 | 17 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 18 | 19 | ### Describe the solution you'd like 20 | 21 | A clear and concise description of what you want to happen. 22 | 23 | ### Describe alternatives you've considered 24 | 25 | A clear and concise description of any alternative solutions or features you've considered. 26 | 27 | ### Additional context 28 | 29 | Add any other context or screenshots about the feature request here. 30 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | 16 | -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/java/com/reactnative/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.reactnative; 2 | 3 | import com.facebook.react.ReactActivity 4 | import com.facebook.react.ReactActivityDelegate 5 | import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled 6 | import com.facebook.react.defaults.DefaultReactActivityDelegate 7 | 8 | class MainActivity : ReactActivity() { 9 | 10 | /** 11 | * Returns the name of the main component registered from JavaScript. This is used to schedule 12 | * rendering of the component. 13 | */ 14 | override fun getMainComponentName(): String = "reactnative" 15 | 16 | /** 17 | * Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate] 18 | * which allows you to enable New Architecture with a single boolean flags [fabricEnabled] 19 | */ 20 | override fun createReactActivityDelegate(): ReactActivityDelegate = 21 | DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled) 22 | } 23 | -------------------------------------------------------------------------------- /packages/react-native/metro.config.js: -------------------------------------------------------------------------------- 1 | const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config'); 2 | 3 | const defaultConfig = getDefaultConfig(__dirname); 4 | 5 | const { 6 | resolver: {sourceExts, assetExts}, 7 | } = getDefaultConfig(__dirname); 8 | 9 | /** 10 | * Metro configuration for React Native 11 | * https://github.com/facebook/react-native 12 | * 13 | * @format 14 | */ 15 | const path = require('path'); 16 | 17 | const config = { 18 | resolver: { 19 | extraNodeModules: new Proxy( 20 | {}, 21 | { 22 | get: (target, name) => path.join(__dirname, `node_modules/${name}`), 23 | }, 24 | ), 25 | assetExts: assetExts.filter(ext => ext !== 'svg'), 26 | sourceExts: [...sourceExts, 'svg'], 27 | }, 28 | transformer: { 29 | getTransformOptions: async () => ({ 30 | transform: { 31 | experimentalImportSupport: false, 32 | inlineRequires: false, 33 | }, 34 | }), 35 | }, 36 | watchFolders: [path.resolve(__dirname, '..', '..')], 37 | }; 38 | 39 | module.exports = mergeConfig(defaultConfig, config); 40 | -------------------------------------------------------------------------------- /packages/react-native/ios/reactnative/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images": [ 3 | { 4 | "idiom": "iphone", 5 | "scale": "2x", 6 | "size": "20x20" 7 | }, 8 | { 9 | "idiom": "iphone", 10 | "scale": "3x", 11 | "size": "20x20" 12 | }, 13 | { 14 | "idiom": "iphone", 15 | "scale": "2x", 16 | "size": "29x29" 17 | }, 18 | { 19 | "idiom": "iphone", 20 | "scale": "3x", 21 | "size": "29x29" 22 | }, 23 | { 24 | "idiom": "iphone", 25 | "scale": "2x", 26 | "size": "40x40" 27 | }, 28 | { 29 | "idiom": "iphone", 30 | "scale": "3x", 31 | "size": "40x40" 32 | }, 33 | { 34 | "idiom": "iphone", 35 | "scale": "2x", 36 | "size": "60x60" 37 | }, 38 | { 39 | "idiom": "iphone", 40 | "scale": "3x", 41 | "size": "60x60" 42 | }, 43 | { 44 | "idiom": "ios-marketing", 45 | "scale": "1x", 46 | "size": "1024x1024" 47 | } 48 | ], 49 | "info": { 50 | "author": "xcode", 51 | "version": 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /packages/react-native/ios/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /packages/react-native/ios/reactnative/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyAccessedAPITypes 6 | 7 | 8 | NSPrivacyAccessedAPIType 9 | NSPrivacyAccessedAPICategoryFileTimestamp 10 | NSPrivacyAccessedAPITypeReasons 11 | 12 | C617.1 13 | 14 | 15 | 16 | NSPrivacyAccessedAPIType 17 | NSPrivacyAccessedAPICategoryUserDefaults 18 | NSPrivacyAccessedAPITypeReasons 19 | 20 | CA92.1 21 | 22 | 23 | 24 | NSPrivacyAccessedAPIType 25 | NSPrivacyAccessedAPICategorySystemBootTime 26 | NSPrivacyAccessedAPITypeReasons 27 | 28 | 35F9.1 29 | 30 | 31 | 32 | NSPrivacyCollectedDataTypes 33 | 34 | NSPrivacyTracking 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /packages/react-native/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | ios/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | **/.cxx 34 | 35 | # node.js 36 | # 37 | node_modules/ 38 | npm-debug.log 39 | yarn-error.log 40 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | *.keystore 45 | !debug.keystore 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/ 53 | 54 | **/fastlane/report.xml 55 | **/fastlane/Preview.html 56 | **/fastlane/screenshots 57 | **/fastlane/test_output 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | # Ruby / CocoaPods 63 | /ios/Pods/ 64 | /vendor/bundle/ 65 | -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 14 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aws-sdk/test", 3 | "version": "1.0.0", 4 | "description": "Monorepo with code samples for testing AWS SDK for JavaScript", 5 | "private": true, 6 | "workspaces": { 7 | "packages": [ 8 | "packages/*" 9 | ] 10 | }, 11 | "scripts": { 12 | "start:node": "(cd packages/node && yarn start:node)", 13 | "start:web": "(cd packages/web && yarn start:web)", 14 | "start:ios": "(cd packages/react-native && yarn ios)", 15 | "start:android": "(cd packages/react-native && yarn android)", 16 | "postinstall": "husky install" 17 | }, 18 | "repository": { 19 | "type": "git", 20 | "url": "git+https://github.com/aws-samples/aws-sdk-js-tests.git" 21 | }, 22 | "keywords": [], 23 | "author": { 24 | "name": "AWS SDK for JavaScript Team", 25 | "url": "https://aws.amazon.com/javascript/" 26 | }, 27 | "license": "MIT-0", 28 | "bugs": { 29 | "url": "https://github.com/aws-samples/aws-sdk-js-tests/issues" 30 | }, 31 | "homepage": "https://github.com/aws-samples/aws-sdk-js-tests#readme", 32 | "devDependencies": { 33 | "husky": "8.0.1", 34 | "lint-staged": "13.0.3", 35 | "prettier": "2.7.1" 36 | }, 37 | "packageManager": "yarn@4.11.0", 38 | "lint-staged": { 39 | "*.{js,css,json,md}": "prettier --write" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /packages/react-native/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Resolve react_native_pods.rb with node to allow for hoisting 2 | require Pod::Executable.execute_command('node', ['-p', 3 | 'require.resolve( 4 | "react-native/scripts/react_native_pods.rb", 5 | {paths: [process.argv[1]]}, 6 | )', __dir__]).strip 7 | 8 | platform :ios, min_ios_version_supported 9 | prepare_react_native_project! 10 | 11 | linkage = ENV['USE_FRAMEWORKS'] 12 | if linkage != nil 13 | Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green 14 | use_frameworks! :linkage => linkage.to_sym 15 | end 16 | 17 | target 'reactnative' do 18 | config = use_native_modules! 19 | 20 | use_react_native!( 21 | :path => config[:reactNativePath], 22 | # An absolute path to your application root. 23 | :app_path => "#{Pod::Config.instance.installation_root}/.." 24 | ) 25 | 26 | target 'reactnativeTests' do 27 | inherit! :complete 28 | # Pods for testing 29 | end 30 | 31 | post_install do |installer| 32 | # https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202 33 | react_native_post_install( 34 | installer, 35 | config[:reactNativePath], 36 | :mac_catalyst_enabled => false, 37 | # :ccache_enabled => true 38 | ) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /packages/react-native/ios/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import React 3 | import React_RCTAppDelegate 4 | import ReactAppDependencyProvider 5 | 6 | @main 7 | class AppDelegate: UIResponder, UIApplicationDelegate { 8 | var window: UIWindow? 9 | 10 | var reactNativeDelegate: ReactNativeDelegate? 11 | var reactNativeFactory: RCTReactNativeFactory? 12 | 13 | func application( 14 | _ application: UIApplication, 15 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil 16 | ) -> Bool { 17 | let delegate = ReactNativeDelegate() 18 | let factory = RCTReactNativeFactory(delegate: delegate) 19 | delegate.dependencyProvider = RCTAppDependencyProvider() 20 | 21 | reactNativeDelegate = delegate 22 | reactNativeFactory = factory 23 | 24 | window = UIWindow(frame: UIScreen.main.bounds) 25 | 26 | factory.startReactNative( 27 | withModuleName: "reactnative", 28 | in: window, 29 | launchOptions: launchOptions 30 | ) 31 | 32 | return true 33 | } 34 | } 35 | 36 | class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate { 37 | override func sourceURL(for bridge: RCTBridge) -> URL? { 38 | self.bundleURL() 39 | } 40 | 41 | override func bundleURL() -> URL? { 42 | #if DEBUG 43 | RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index") 44 | #else 45 | Bundle.main.url(forResource: "main", withExtension: "jsbundle") 46 | #endif 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /packages/react-native/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@aws-sdk/test-react-native", 3 | "version": "1.0.0", 4 | "description": "Code samples to test AWS SDK for JavaScript in React Native environment", 5 | "private": true, 6 | "scripts": { 7 | "android": "react-native run-android", 8 | "ios": "(cd ios && pod install) && react-native run-ios", 9 | "start": "react-native start" 10 | }, 11 | "dependencies": { 12 | "@aws-sdk/test-utils": "workspace:*", 13 | "react": "19.1.0", 14 | "react-native": "^0.81.5", 15 | "react-native-get-random-values": "^1.11.0", 16 | "react-native-url-polyfill": "^2.0.0", 17 | "serialize-error": "^11.0.3", 18 | "web-streams-polyfill": "^4.0.0" 19 | }, 20 | "devDependencies": { 21 | "@babel/core": "^7.12.9", 22 | "@babel/plugin-transform-class-static-block": "^7.12.5", 23 | "@babel/runtime": "^7.12.5", 24 | "@react-native-community/cli": "^19.1.1", 25 | "@react-native/babel-preset": "^0.81.5", 26 | "@react-native/metro-config": "^0.81.5" 27 | }, 28 | "author": { 29 | "name": "AWS SDK for JavaScript Team", 30 | "url": "https://aws.amazon.com/javascript/" 31 | }, 32 | "license": "MIT-0", 33 | "homepage": "https://github.com/aws-samples/aws-sdk-js-tests/tree/main/packages/react-native", 34 | "repository": { 35 | "type": "git", 36 | "url": "https://github.com/aws-samples/aws-sdk-js-tests.git", 37 | "directory": "packages/react-native" 38 | }, 39 | "installConfig": { 40 | "hoistingLimits": "workspaces" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /packages/react-native/android/app/src/main/java/com/reactnative/MainApplication.kt: -------------------------------------------------------------------------------- 1 | package com.reactnative 2 | 3 | import android.app.Application 4 | import com.facebook.react.PackageList 5 | import com.facebook.react.ReactApplication 6 | import com.facebook.react.ReactHost 7 | import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative 8 | import com.facebook.react.ReactNativeHost 9 | import com.facebook.react.ReactPackage 10 | import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost 11 | import com.facebook.react.defaults.DefaultReactNativeHost 12 | 13 | class MainApplication : Application(), ReactApplication { 14 | 15 | override val reactNativeHost: ReactNativeHost = 16 | object : DefaultReactNativeHost(this) { 17 | override fun getPackages(): List = 18 | PackageList(this).packages.apply { 19 | // Packages that cannot be autolinked yet can be added manually here, for example: 20 | // add(MyReactNativePackage()) 21 | } 22 | 23 | override fun getJSMainModuleName(): String = "index" 24 | 25 | override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG 26 | 27 | override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED 28 | override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED 29 | } 30 | 31 | override val reactHost: ReactHost 32 | get() = getDefaultReactHost(applicationContext, reactNativeHost) 33 | 34 | override fun onCreate() { 35 | super.onCreate() 36 | loadReactNative(this) 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /packages/react-native/ios/reactnative/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | reactnative 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 0.0.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(CURRENT_PROJECT_VERSION) 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSAllowsLocalNetworking 32 | 33 | 34 | NSLocationWhenInUseUsageDescription 35 | 36 | RCTNewArchEnabled 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | arm64 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /packages/react-native/App.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | * @flow strict-local 7 | */ 8 | 9 | import React, { useState } from 'react'; 10 | import { Button, StyleSheet, View, Text, TextInput } from 'react-native'; 11 | import { serializeError } from 'serialize-error'; 12 | 13 | // React Native polyfills required for AWS SDK for JavaScript. 14 | import 'react-native-get-random-values'; 15 | import 'react-native-url-polyfill/auto'; 16 | import 'web-streams-polyfill/polyfill'; 17 | 18 | import { getBrowserResponse } from '@aws-sdk/test-utils'; 19 | 20 | const App: () => Node = () => { 21 | const [response, setResponse] = useState(''); 22 | 23 | const fetchResponse = async () => { 24 | try { 25 | const response = await getBrowserResponse(); 26 | setResponse(JSON.stringify(response, null, 2)); 27 | } catch (err) { 28 | console.error(serializeError(err)); 29 | setResponse(`Error: ${err}. Check console for more details.`); 30 | } 31 | }; 32 | 33 | return ( 34 | 35 | 36 | AWS SDK for JavaScript: 37 |