diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..62512a1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,21 @@ +#amplify-do-not-edit-begin +amplify/\#current-cloud-backend +amplify/.config/local-* +amplify/logs +amplify/mock-data +amplify/backend/amplify-meta.json +amplify/backend/awscloudformation +amplify/backend/.temp +build/ +dist/ +node_modules/ +aws-exports.js +awsconfiguration.json +amplifyconfiguration.json +amplifyconfiguration.dart +amplify-build-config.json +amplify-gradle-config.json +amplifytools.xcconfig +.secret-* +**.sample +#amplify-do-not-edit-end \ No newline at end of file diff --git a/.graphqlconfig.yml b/.graphqlconfig.yml new file mode 100644 index 0000000..1ce0182 --- /dev/null +++ b/.graphqlconfig.yml @@ -0,0 +1,15 @@ +projects: + BackendBuildTest: + schemaPath: amplify/backend/api/BackendBuildTest/build/schema.graphql + includes: + - src/graphql/**/*.js + excludes: + - ./amplify/** + extensions: + amplify: + codeGenTarget: javascript + generatedFileName: '' + docsFilePath: src/graphql + region: us-west-2 + apiId: null + maxDepth: 2 diff --git a/README.md b/README.md new file mode 100644 index 0000000..8eaafe2 --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Backend Build Integration Test + +- Uses node v14 +- Uses Amplify CLI 5.1.3 +- Creates an AppSync API +- Used codegen to generate graphql statements and types \ No newline at end of file diff --git a/amplify.yml b/amplify.yml new file mode 100644 index 0000000..502b65e --- /dev/null +++ b/amplify.yml @@ -0,0 +1,19 @@ +version: 1 +backend: + phases: + preBuild: + commands: + - nvm install 14 + - nvm use 14 + - npm install -g @aws-amplify/cli@6.3.1 + build: + commands: + - amplifyPush --simple +frontend: + phases: + build: + commands: + - echo "true" + artifacts: + baseDirectory: src + files: "**/*" \ No newline at end of file diff --git a/amplify/.config/project-config.json b/amplify/.config/project-config.json new file mode 100644 index 0000000..d6b35f1 --- /dev/null +++ b/amplify/.config/project-config.json @@ -0,0 +1,17 @@ +{ + "projectName": "BackendBuildTest", + "version": "3.1", + "frontend": "javascript", + "javascript": { + "framework": "none", + "config": { + "SourceDir": "src", + "DistributionDir": "dist", + "BuildCommand": "npm run-script build", + "StartCommand": "npm run-script start" + } + }, + "providers": [ + "awscloudformation" + ] +} \ No newline at end of file diff --git a/amplify/README.md b/amplify/README.md new file mode 100644 index 0000000..7c0a9e2 --- /dev/null +++ b/amplify/README.md @@ -0,0 +1,8 @@ +# Getting Started with Amplify CLI +This directory was generated by [Amplify CLI](https://docs.amplify.aws/cli). + +Helpful resources: +- Amplify documentation: https://docs.amplify.aws +- Amplify CLI documentation: https://docs.amplify.aws/cli +- More details on this folder & generated files: https://docs.amplify.aws/cli/reference/files +- Join Amplify's community: https://amplify.aws/community/ diff --git a/amplify/backend/api/BackendBuildTest/parameters.json b/amplify/backend/api/BackendBuildTest/parameters.json new file mode 100644 index 0000000..ce62552 --- /dev/null +++ b/amplify/backend/api/BackendBuildTest/parameters.json @@ -0,0 +1,5 @@ +{ + "AppSyncApiName": "BackendBuildTest", + "DynamoDBBillingMode": "PAY_PER_REQUEST", + "DynamoDBEnableServerSideEncryption": false +} \ No newline at end of file diff --git a/amplify/backend/api/BackendBuildTest/resolvers/README.md b/amplify/backend/api/BackendBuildTest/resolvers/README.md new file mode 100644 index 0000000..89e564c --- /dev/null +++ b/amplify/backend/api/BackendBuildTest/resolvers/README.md @@ -0,0 +1,2 @@ +Any resolvers that you add in this directory will override the ones automatically generated by Amplify CLI and will be directly copied to the cloud. +For more information, visit [https://docs.amplify.aws/cli/graphql-transformer/resolvers](https://docs.amplify.aws/cli/graphql-transformer/resolvers) \ No newline at end of file diff --git a/amplify/backend/api/BackendBuildTest/schema.graphql b/amplify/backend/api/BackendBuildTest/schema.graphql new file mode 100644 index 0000000..74b097c --- /dev/null +++ b/amplify/backend/api/BackendBuildTest/schema.graphql @@ -0,0 +1,5 @@ +type Todo @model { + id: ID! + name: String! + description: String +} diff --git a/amplify/backend/api/BackendBuildTest/stacks/CustomResources.json b/amplify/backend/api/BackendBuildTest/stacks/CustomResources.json new file mode 100644 index 0000000..f95feea --- /dev/null +++ b/amplify/backend/api/BackendBuildTest/stacks/CustomResources.json @@ -0,0 +1,58 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "An auto-generated nested stack.", + "Metadata": {}, + "Parameters": { + "AppSyncApiId": { + "Type": "String", + "Description": "The id of the AppSync API associated with this project." + }, + "AppSyncApiName": { + "Type": "String", + "Description": "The name of the AppSync API", + "Default": "AppSyncSimpleTransform" + }, + "env": { + "Type": "String", + "Description": "The environment name. e.g. Dev, Test, or Production", + "Default": "NONE" + }, + "S3DeploymentBucket": { + "Type": "String", + "Description": "The S3 bucket containing all deployment assets for the project." + }, + "S3DeploymentRootKey": { + "Type": "String", + "Description": "An S3 key relative to the S3DeploymentBucket that points to the root\nof the deployment directory." + } + }, + "Resources": { + "EmptyResource": { + "Type": "Custom::EmptyResource", + "Condition": "AlwaysFalse" + } + }, + "Conditions": { + "HasEnvironmentParameter": { + "Fn::Not": [ + { + "Fn::Equals": [ + { + "Ref": "env" + }, + "NONE" + ] + } + ] + }, + "AlwaysFalse": { + "Fn::Equals": ["true", "false"] + } + }, + "Outputs": { + "EmptyOutput": { + "Description": "An empty output. You may delete this if you have at least one resource above.", + "Value": "" + } + } +} diff --git a/amplify/backend/api/BackendBuildTest/transform.conf.json b/amplify/backend/api/BackendBuildTest/transform.conf.json new file mode 100644 index 0000000..98e1e19 --- /dev/null +++ b/amplify/backend/api/BackendBuildTest/transform.conf.json @@ -0,0 +1,4 @@ +{ + "Version": 5, + "ElasticsearchWarning": true +} \ No newline at end of file diff --git a/amplify/backend/backend-config.json b/amplify/backend/backend-config.json new file mode 100644 index 0000000..18361b4 --- /dev/null +++ b/amplify/backend/backend-config.json @@ -0,0 +1,20 @@ +{ + "api": { + "BackendBuildTest": { + "service": "AppSync", + "providerPlugin": "awscloudformation", + "output": { + "authConfig": { + "defaultAuthentication": { + "authenticationType": "API_KEY", + "apiKeyConfig": { + "apiKeyExpirationDays": 365, + "description": "" + } + }, + "additionalAuthenticationProviders": [] + } + } + } + } +} \ No newline at end of file diff --git a/amplify/backend/tags.json b/amplify/backend/tags.json new file mode 100644 index 0000000..b9321d7 --- /dev/null +++ b/amplify/backend/tags.json @@ -0,0 +1,10 @@ +[ + { + "Key": "user:Stack", + "Value": "{project-env}" + }, + { + "Key": "user:Application", + "Value": "{project-name}" + } +] \ No newline at end of file diff --git a/amplify/cli.json b/amplify/cli.json new file mode 100644 index 0000000..3440a11 --- /dev/null +++ b/amplify/cli.json @@ -0,0 +1,45 @@ +{ + "features": { + "graphqltransformer": { + "addmissingownerfields": true, + "improvepluralization": false, + "validatetypenamereservedwords": true, + "useexperimentalpipelinedtransformer": false, + "enableiterativegsiupdates": true, + "secondarykeyasgsi": true, + "skipoverridemutationinputtypes": true + }, + "frontend-ios": { + "enablexcodeintegration": true + }, + "auth": { + "enablecaseinsensitivity": true, + "useinclusiveterminology": true, + "breakcirculardependency": true, + "forcealiasattributes": false + }, + "codegen": { + "useappsyncmodelgenplugin": true, + "usedocsgeneratorplugin": true, + "usetypesgeneratorplugin": true, + "cleangeneratedmodelsdirectory": true, + "retaincasestyle": true, + "addtimestampfields": true, + "handlelistnullabilitytransparently": true, + "emitauthprovider": true, + "generateindexrules": true, + "enabledartnullsafety": true + }, + "appsync": { + "generategraphqlpermissions": true + }, + "latestregionsupport": { + "pinpoint": 1, + "translate": 1, + "transcribe": 1, + "rekognition": 1, + "textract": 1, + "comprehend": 1 + } + } +} \ No newline at end of file diff --git a/amplify/hooks/README.md b/amplify/hooks/README.md new file mode 100644 index 0000000..8fb601e --- /dev/null +++ b/amplify/hooks/README.md @@ -0,0 +1,7 @@ +# Command Hooks + +Command hooks can be used to run custom scripts upon Amplify CLI lifecycle events like pre-push, post-add-function, etc. + +To get started, add your script files based on the expected naming convention in this directory. + +Learn more about the script file naming convention, hook parameters, third party dependencies, and advanced configurations at https://docs.amplify.aws/cli/usage/command-hooks diff --git a/src/graphql/mutations.js b/src/graphql/mutations.js new file mode 100644 index 0000000..7e6fb59 --- /dev/null +++ b/src/graphql/mutations.js @@ -0,0 +1,45 @@ +/* eslint-disable */ +// this is an auto generated file. This will be overwritten + +export const createTodo = /* GraphQL */ ` + mutation CreateTodo( + $input: CreateTodoInput! + $condition: ModelTodoConditionInput + ) { + createTodo(input: $input, condition: $condition) { + id + name + description + createdAt + updatedAt + } + } +`; +export const updateTodo = /* GraphQL */ ` + mutation UpdateTodo( + $input: UpdateTodoInput! + $condition: ModelTodoConditionInput + ) { + updateTodo(input: $input, condition: $condition) { + id + name + description + createdAt + updatedAt + } + } +`; +export const deleteTodo = /* GraphQL */ ` + mutation DeleteTodo( + $input: DeleteTodoInput! + $condition: ModelTodoConditionInput + ) { + deleteTodo(input: $input, condition: $condition) { + id + name + description + createdAt + updatedAt + } + } +`; diff --git a/src/graphql/queries.js b/src/graphql/queries.js new file mode 100644 index 0000000..0260171 --- /dev/null +++ b/src/graphql/queries.js @@ -0,0 +1,32 @@ +/* eslint-disable */ +// this is an auto generated file. This will be overwritten + +export const getTodo = /* GraphQL */ ` + query GetTodo($id: ID!) { + getTodo(id: $id) { + id + name + description + createdAt + updatedAt + } + } +`; +export const listTodos = /* GraphQL */ ` + query ListTodos( + $filter: ModelTodoFilterInput + $limit: Int + $nextToken: String + ) { + listTodos(filter: $filter, limit: $limit, nextToken: $nextToken) { + items { + id + name + description + createdAt + updatedAt + } + nextToken + } + } +`; diff --git a/src/graphql/subscriptions.js b/src/graphql/subscriptions.js new file mode 100644 index 0000000..890a1d5 --- /dev/null +++ b/src/graphql/subscriptions.js @@ -0,0 +1,36 @@ +/* eslint-disable */ +// this is an auto generated file. This will be overwritten + +export const onCreateTodo = /* GraphQL */ ` + subscription OnCreateTodo { + onCreateTodo { + id + name + description + createdAt + updatedAt + } + } +`; +export const onUpdateTodo = /* GraphQL */ ` + subscription OnUpdateTodo { + onUpdateTodo { + id + name + description + createdAt + updatedAt + } + } +`; +export const onDeleteTodo = /* GraphQL */ ` + subscription OnDeleteTodo { + onDeleteTodo { + id + name + description + createdAt + updatedAt + } + } +`; diff --git a/src/index.html b/src/index.html new file mode 100644 index 0000000..aa8cc5c --- /dev/null +++ b/src/index.html @@ -0,0 +1,11 @@ + + + + + Backend Integration Test + + +

Backend builds

+

Hello world

+ +