├── .expo-shared
└── assets.json
├── .graphqlconfig.yml
├── .idea
├── amplifyProject.iml
├── misc.xml
├── modules.xml
└── vcs.xml
├── .watchmanconfig
├── App.js
├── amplify
├── #current-cloud-backend
│ ├── amplify-meta.json
│ ├── api
│ │ └── todoApi
│ │ │ ├── build
│ │ │ ├── cloudformation-template.json
│ │ │ ├── parameters.json
│ │ │ └── schema.graphql
│ │ │ └── schema.graphql
│ └── backend-config.json
├── backend
│ ├── amplify-meta.json
│ ├── api
│ │ └── todoApi
│ │ │ ├── build
│ │ │ ├── cloudformation-template.json
│ │ │ ├── parameters.json
│ │ │ └── schema.graphql
│ │ │ └── schema.graphql
│ ├── auth
│ │ └── amplifyprojectb3fea6ea
│ │ │ ├── amplifyprojectb3fea6ea-cloudformation-template.yml
│ │ │ └── parameters.json
│ ├── awscloudformation
│ │ └── nested-cloudformation-stack.yml
│ └── backend-config.json
└── team-provider-info.json
├── aws-exports.js
├── package-lock.json
├── package.json
└── src
├── components
├── Bottom.js
├── Dialog.js
├── Header.js
├── OAuthButton.js
├── Todos.js
├── actions.js
├── dialogReducer.js
├── filterReducer.js
├── forgotPassword
│ ├── ForgotPassword.js
│ └── ForgotPasswordConfirm.js
├── helpers.js
├── reducers.js
├── signIn
│ └── SignIn.js
├── signUp
│ ├── SignUp.js
│ └── SignUpConfirm.js
└── store.js
├── graphql
├── mutations.js
├── queries.js
├── schema.json
└── subscriptions.js
├── navigation
├── appFlowNav.js
├── authNavigation.js
├── forgotPassword.js
└── index.js
└── screens
└── HomeScreen.js
/.expo-shared/assets.json:
--------------------------------------------------------------------------------
1 | {
2 | "f9155ac790fd02fadcdeca367b02581c04a353aa6d5aa84409a59f6804c87acd": true,
3 | "89ed26367cdb9b771858e026f2eb95bfdb90e5ae943e716575327ec325f39c44": true
4 | }
--------------------------------------------------------------------------------
/.graphqlconfig.yml:
--------------------------------------------------------------------------------
1 | projects:
2 | todoApi:
3 | schemaPath: src/graphql/schema.json
4 | includes:
5 | - src/graphql/**/*.js
6 | excludes:
7 | - ./amplify/**
8 | extensions:
9 | amplify:
10 | codeGenTarget: javascript
11 | generatedFileName: ''
12 | docsFilePath: src/graphql
13 |
--------------------------------------------------------------------------------
/.idea/amplifyProject.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/App.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {Provider} from 'react-redux';
3 | import {store} from './src/components/store';
4 | import HomeScreen from "./src/screens/HomeScreen";
5 | import Amplify from 'aws-amplify';
6 | import Navigation from './src/navigation';
7 |
8 | import awsconfig from './aws-exports';
9 | import { withAuthenticator } from 'aws-amplify-react-native';
10 |
11 | Amplify.configure(awsconfig);
12 |
13 |
14 | const App = () => {
15 | return (
16 |
17 | {/**/}
18 | {/* */}
19 | {/**/}
20 |
21 |
22 |
23 | );
24 | };
25 |
26 | export default App;
--------------------------------------------------------------------------------
/amplify/#current-cloud-backend/amplify-meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "providers": {
3 | "awscloudformation": {
4 | "AuthRoleName": "amplifyproject-test-20190919143906-authRole",
5 | "UnauthRoleArn": "arn:aws:iam::082042224423:role/amplifyproject-test-20190919143906-unauthRole",
6 | "AuthRoleArn": "arn:aws:iam::082042224423:role/amplifyproject-test-20190919143906-authRole",
7 | "Region": "us-east-1",
8 | "DeploymentBucketName": "amplifyproject-test-20190919143906-deployment",
9 | "UnauthRoleName": "amplifyproject-test-20190919143906-unauthRole",
10 | "StackName": "amplifyproject-test-20190919143906",
11 | "StackId": "arn:aws:cloudformation:us-east-1:082042224423:stack/amplifyproject-test-20190919143906/17196b80-dad2-11e9-a39a-0e8cd4caae34"
12 | }
13 | },
14 | "api": {
15 | "todoApi": {
16 | "service": "AppSync",
17 | "providerPlugin": "awscloudformation",
18 | "output": {
19 | "authConfig": {
20 | "additionalAuthenticationProviders": [],
21 | "defaultAuthentication": {
22 | "authenticationType": "API_KEY",
23 | "apiKeyConfig": {
24 | "description": "API key desc",
25 | "apiKeyExpirationDays": 180
26 | }
27 | }
28 | },
29 | "GraphQLAPIIdOutput": "uuhw536vujaphbrqpfajkp32nm",
30 | "GraphQLAPIEndpointOutput": "https://6oqacvdcd5ehbkhflibujnjzpy.appsync-api.us-east-1.amazonaws.com/graphql",
31 | "GraphQLAPIKeyOutput": "da2-iawhwbfha5c3dhf3efuwpxphxy"
32 | },
33 | "providerMetadata": {
34 | "s3TemplateURL": "https://s3.amazonaws.com/amplifyproject-test-20190919143906-deployment/amplify-cfn-templates/api/cloudformation-template.json",
35 | "logicalId": "apitodoApi"
36 | },
37 | "lastPushTimeStamp": "2019-10-01T09:09:30.142Z",
38 | "lastPushDirHash": "mxXk6l5KNOtkouTdh7lzbjTwibM="
39 | }
40 | },
41 | "auth": {
42 | "amplifyprojectb3fea6ea": {
43 | "service": "Cognito",
44 | "providerPlugin": "awscloudformation",
45 | "dependsOn": [],
46 | "providerMetadata": {
47 | "s3TemplateURL": "https://s3.amazonaws.com/amplifyproject-test-20190919143906-deployment/amplify-cfn-templates/auth/amplifyprojectb3fea6ea-cloudformation-template.yml",
48 | "logicalId": "authamplifyprojectb3fea6ea"
49 | },
50 | "lastPushTimeStamp": "2019-10-01T09:09:30.144Z",
51 | "output": {
52 | "AppClientSecret": "eq1842m668qrllirihf2ef9du1tpgg4h253oujo5plc4vdilbqd",
53 | "UserPoolId": "us-east-1_JEGRSXJ1m",
54 | "AppClientIDWeb": "1siqsh7nie77r156gmpve4bdh5",
55 | "AppClientID": "30mmpk81nmdg900fqci2fr2jqi",
56 | "HostedUIDomain": "amplifyprojectb3fea6ea-b3fea6ea-test",
57 | "IdentityPoolId": "us-east-1:4b34cfd5-e707-4432-9a9c-49a6b2eb4723",
58 | "IdentityPoolName": "amplifyprojectb3fea6ea_identitypool_b3fea6ea__test",
59 | "OAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"https://192.168.0.80:19006/\"],\"LogoutURLs\":[\"https://192.168.0.80:19006/\"]}",
60 | "UserPoolName": "amplifyprojectb3fea6ea_userpool_b3fea6ea"
61 | },
62 | "lastPushDirHash": "CIyQxc9lLwnKX9iCcKX/cNkb+3s="
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/amplify/#current-cloud-backend/api/todoApi/build/cloudformation-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion": "2010-09-09",
3 | "Description": "An auto-generated nested stack.",
4 | "Metadata": {},
5 | "Parameters": {
6 | "DynamoDBModelTableReadIOPS": {
7 | "Type": "Number",
8 | "Description": "The number of read IOPS the table should support.",
9 | "Default": 5
10 | },
11 | "DynamoDBModelTableWriteIOPS": {
12 | "Type": "Number",
13 | "Description": "The number of write IOPS the table should support.",
14 | "Default": 5
15 | },
16 | "DynamoDBBillingMode": {
17 | "Type": "String",
18 | "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes.",
19 | "Default": "PAY_PER_REQUEST",
20 | "AllowedValues": [
21 | "PAY_PER_REQUEST",
22 | "PROVISIONED"
23 | ]
24 | },
25 | "DynamoDBEnablePointInTimeRecovery": {
26 | "Type": "String",
27 | "Description": "Whether to enable Point in Time Recovery on the table",
28 | "Default": "false",
29 | "AllowedValues": [
30 | "true",
31 | "false"
32 | ]
33 | },
34 | "DynamoDBEnableServerSideEncryption": {
35 | "Type": "String",
36 | "Description": "Enable server side encryption powered by KMS.",
37 | "Default": "true",
38 | "AllowedValues": [
39 | "true",
40 | "false"
41 | ]
42 | },
43 | "AppSyncApiName": {
44 | "Type": "String",
45 | "Description": "The name of the AppSync API",
46 | "Default": "AppSyncSimpleTransform"
47 | },
48 | "APIKeyExpirationEpoch": {
49 | "Type": "Number",
50 | "Description": "The epoch time in seconds when the API Key should expire. Setting this to 0 will default to 180 days from the deployment date. Setting this to -1 will not create an API Key.",
51 | "Default": 0,
52 | "MinValue": -1
53 | },
54 | "CreateAPIKey": {
55 | "Type": "Number",
56 | "Description": "The boolean value to control if an API Key will be created or not. The value of the property is automatically set by the CLI. If the value is set to 0 no API Key will be created.",
57 | "Default": 0,
58 | "MinValue": 0,
59 | "MaxValue": 1
60 | },
61 | "AuthCognitoUserPoolId": {
62 | "Type": "String",
63 | "Description": "The id of an existing User Pool to connect. If this is changed, a user pool will not be created for you.",
64 | "Default": "NONE"
65 | },
66 | "env": {
67 | "Type": "String",
68 | "Description": "The environment name. e.g. Dev, Test, or Production",
69 | "Default": "NONE"
70 | },
71 | "S3DeploymentBucket": {
72 | "Type": "String",
73 | "Description": "The S3 bucket containing all deployment assets for the project."
74 | },
75 | "S3DeploymentRootKey": {
76 | "Type": "String",
77 | "Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory."
78 | }
79 | },
80 | "Resources": {
81 | "GraphQLAPI": {
82 | "Type": "AWS::AppSync::GraphQLApi",
83 | "Properties": {
84 | "Name": {
85 | "Fn::If": [
86 | "HasEnvironmentParameter",
87 | {
88 | "Fn::Join": [
89 | "-",
90 | [
91 | {
92 | "Ref": "AppSyncApiName"
93 | },
94 | {
95 | "Ref": "env"
96 | }
97 | ]
98 | ]
99 | },
100 | {
101 | "Ref": "AppSyncApiName"
102 | }
103 | ]
104 | },
105 | "AuthenticationType": "API_KEY"
106 | }
107 | },
108 | "GraphQLAPIKey": {
109 | "Type": "AWS::AppSync::ApiKey",
110 | "Properties": {
111 | "ApiId": {
112 | "Fn::GetAtt": [
113 | "GraphQLAPI",
114 | "ApiId"
115 | ]
116 | },
117 | "Description": "API key desc",
118 | "Expires": {
119 | "Fn::If": [
120 | "APIKeyExpirationEpochIsPositive",
121 | {
122 | "Ref": "APIKeyExpirationEpoch"
123 | },
124 | 1584889985
125 | ]
126 | }
127 | },
128 | "Condition": "ShouldCreateAPIKey"
129 | },
130 | "GraphQLSchema": {
131 | "Type": "AWS::AppSync::GraphQLSchema",
132 | "Properties": {
133 | "ApiId": {
134 | "Fn::GetAtt": [
135 | "GraphQLAPI",
136 | "ApiId"
137 | ]
138 | },
139 | "DefinitionS3Location": {
140 | "Fn::Sub": [
141 | "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/schema.graphql",
142 | {
143 | "S3DeploymentBucket": {
144 | "Ref": "S3DeploymentBucket"
145 | },
146 | "S3DeploymentRootKey": {
147 | "Ref": "S3DeploymentRootKey"
148 | }
149 | }
150 | ]
151 | }
152 | }
153 | },
154 | "Todo": {
155 | "Type": "AWS::CloudFormation::Stack",
156 | "Properties": {
157 | "Parameters": {
158 | "AppSyncApiId": {
159 | "Fn::GetAtt": [
160 | "GraphQLAPI",
161 | "ApiId"
162 | ]
163 | },
164 | "DynamoDBModelTableReadIOPS": {
165 | "Ref": "DynamoDBModelTableReadIOPS"
166 | },
167 | "DynamoDBModelTableWriteIOPS": {
168 | "Ref": "DynamoDBModelTableWriteIOPS"
169 | },
170 | "DynamoDBBillingMode": {
171 | "Ref": "DynamoDBBillingMode"
172 | },
173 | "DynamoDBEnablePointInTimeRecovery": {
174 | "Ref": "DynamoDBEnablePointInTimeRecovery"
175 | },
176 | "DynamoDBEnableServerSideEncryption": {
177 | "Ref": "DynamoDBEnableServerSideEncryption"
178 | },
179 | "AppSyncApiName": {
180 | "Ref": "AppSyncApiName"
181 | },
182 | "APIKeyExpirationEpoch": {
183 | "Ref": "APIKeyExpirationEpoch"
184 | },
185 | "CreateAPIKey": {
186 | "Ref": "CreateAPIKey"
187 | },
188 | "AuthCognitoUserPoolId": {
189 | "Ref": "AuthCognitoUserPoolId"
190 | },
191 | "env": {
192 | "Ref": "env"
193 | },
194 | "S3DeploymentBucket": {
195 | "Ref": "S3DeploymentBucket"
196 | },
197 | "S3DeploymentRootKey": {
198 | "Ref": "S3DeploymentRootKey"
199 | },
200 | "GetAttGraphQLAPIApiId": {
201 | "Fn::GetAtt": [
202 | "GraphQLAPI",
203 | "ApiId"
204 | ]
205 | }
206 | },
207 | "TemplateURL": {
208 | "Fn::Join": [
209 | "/",
210 | [
211 | "https://s3.amazonaws.com",
212 | {
213 | "Ref": "S3DeploymentBucket"
214 | },
215 | {
216 | "Ref": "S3DeploymentRootKey"
217 | },
218 | "stacks",
219 | "Todo.json"
220 | ]
221 | ]
222 | }
223 | },
224 | "DependsOn": [
225 | "GraphQLSchema"
226 | ]
227 | },
228 | "CustomResourcesjson": {
229 | "Type": "AWS::CloudFormation::Stack",
230 | "Properties": {
231 | "Parameters": {
232 | "AppSyncApiId": {
233 | "Fn::GetAtt": [
234 | "GraphQLAPI",
235 | "ApiId"
236 | ]
237 | },
238 | "AppSyncApiName": {
239 | "Ref": "AppSyncApiName"
240 | },
241 | "env": {
242 | "Ref": "env"
243 | },
244 | "S3DeploymentBucket": {
245 | "Ref": "S3DeploymentBucket"
246 | },
247 | "S3DeploymentRootKey": {
248 | "Ref": "S3DeploymentRootKey"
249 | }
250 | },
251 | "TemplateURL": {
252 | "Fn::Join": [
253 | "/",
254 | [
255 | "https://s3.amazonaws.com",
256 | {
257 | "Ref": "S3DeploymentBucket"
258 | },
259 | {
260 | "Ref": "S3DeploymentRootKey"
261 | },
262 | "stacks",
263 | "CustomResources.json"
264 | ]
265 | ]
266 | }
267 | },
268 | "DependsOn": [
269 | "GraphQLAPI",
270 | "GraphQLSchema",
271 | "Todo"
272 | ]
273 | }
274 | },
275 | "Outputs": {
276 | "GraphQLAPIIdOutput": {
277 | "Description": "Your GraphQL API ID.",
278 | "Value": {
279 | "Fn::GetAtt": [
280 | "GraphQLAPI",
281 | "ApiId"
282 | ]
283 | },
284 | "Export": {
285 | "Name": {
286 | "Fn::Join": [
287 | ":",
288 | [
289 | {
290 | "Ref": "AWS::StackName"
291 | },
292 | "GraphQLApiId"
293 | ]
294 | ]
295 | }
296 | }
297 | },
298 | "GraphQLAPIEndpointOutput": {
299 | "Description": "Your GraphQL API endpoint.",
300 | "Value": {
301 | "Fn::GetAtt": [
302 | "GraphQLAPI",
303 | "GraphQLUrl"
304 | ]
305 | },
306 | "Export": {
307 | "Name": {
308 | "Fn::Join": [
309 | ":",
310 | [
311 | {
312 | "Ref": "AWS::StackName"
313 | },
314 | "GraphQLApiEndpoint"
315 | ]
316 | ]
317 | }
318 | }
319 | },
320 | "GraphQLAPIKeyOutput": {
321 | "Description": "Your GraphQL API key. Provide via 'x-api-key' header.",
322 | "Value": {
323 | "Fn::GetAtt": [
324 | "GraphQLAPIKey",
325 | "ApiKey"
326 | ]
327 | },
328 | "Export": {
329 | "Name": {
330 | "Fn::Join": [
331 | ":",
332 | [
333 | {
334 | "Ref": "AWS::StackName"
335 | },
336 | "GraphQLApiKey"
337 | ]
338 | ]
339 | }
340 | },
341 | "Condition": "ShouldCreateAPIKey"
342 | }
343 | },
344 | "Conditions": {
345 | "ShouldUsePayPerRequestBilling": {
346 | "Fn::Equals": [
347 | {
348 | "Ref": "DynamoDBBillingMode"
349 | },
350 | "PAY_PER_REQUEST"
351 | ]
352 | },
353 | "ShouldUsePointInTimeRecovery": {
354 | "Fn::Equals": [
355 | {
356 | "Ref": "DynamoDBEnablePointInTimeRecovery"
357 | },
358 | "true"
359 | ]
360 | },
361 | "ShouldUseServerSideEncryption": {
362 | "Fn::Equals": [
363 | {
364 | "Ref": "DynamoDBEnableServerSideEncryption"
365 | },
366 | "true"
367 | ]
368 | },
369 | "ShouldCreateAPIKey": {
370 | "Fn::Equals": [
371 | {
372 | "Ref": "CreateAPIKey"
373 | },
374 | 1
375 | ]
376 | },
377 | "APIKeyExpirationEpochIsPositive": {
378 | "Fn::And": [
379 | {
380 | "Fn::Not": [
381 | {
382 | "Fn::Equals": [
383 | {
384 | "Ref": "APIKeyExpirationEpoch"
385 | },
386 | -1
387 | ]
388 | }
389 | ]
390 | },
391 | {
392 | "Fn::Not": [
393 | {
394 | "Fn::Equals": [
395 | {
396 | "Ref": "APIKeyExpirationEpoch"
397 | },
398 | 0
399 | ]
400 | }
401 | ]
402 | }
403 | ]
404 | },
405 | "HasEnvironmentParameter": {
406 | "Fn::Not": [
407 | {
408 | "Fn::Equals": [
409 | {
410 | "Ref": "env"
411 | },
412 | "NONE"
413 | ]
414 | }
415 | ]
416 | }
417 | }
418 | }
--------------------------------------------------------------------------------
/amplify/#current-cloud-backend/api/todoApi/build/parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "CreateAPIKey": 1,
3 | "AppSyncApiName": "todoApi",
4 | "DynamoDBBillingMode": "PAY_PER_REQUEST",
5 | "DynamoDBEnableServerSideEncryption": "false",
6 | "S3DeploymentBucket": "amplifyproject-test-20190919143906-deployment",
7 | "S3DeploymentRootKey": "amplify-appsync-files/4b4b159fa3fedb4ab8ed48d581bcb35cf038c826"
8 | }
--------------------------------------------------------------------------------
/amplify/#current-cloud-backend/api/todoApi/build/schema.graphql:
--------------------------------------------------------------------------------
1 | type Todo {
2 | id: ID!
3 | name: String!
4 | description: String
5 | time: String
6 | completed: Boolean
7 | }
8 |
9 | enum ModelSortDirection {
10 | ASC
11 | DESC
12 | }
13 |
14 | type ModelTodoConnection {
15 | items: [Todo]
16 | nextToken: String
17 | }
18 |
19 | input ModelStringFilterInput {
20 | ne: String
21 | eq: String
22 | le: String
23 | lt: String
24 | ge: String
25 | gt: String
26 | contains: String
27 | notContains: String
28 | between: [String]
29 | beginsWith: String
30 | }
31 |
32 | input ModelIDFilterInput {
33 | ne: ID
34 | eq: ID
35 | le: ID
36 | lt: ID
37 | ge: ID
38 | gt: ID
39 | contains: ID
40 | notContains: ID
41 | between: [ID]
42 | beginsWith: ID
43 | }
44 |
45 | input ModelIntFilterInput {
46 | ne: Int
47 | eq: Int
48 | le: Int
49 | lt: Int
50 | ge: Int
51 | gt: Int
52 | contains: Int
53 | notContains: Int
54 | between: [Int]
55 | }
56 |
57 | input ModelFloatFilterInput {
58 | ne: Float
59 | eq: Float
60 | le: Float
61 | lt: Float
62 | ge: Float
63 | gt: Float
64 | contains: Float
65 | notContains: Float
66 | between: [Float]
67 | }
68 |
69 | input ModelBooleanFilterInput {
70 | ne: Boolean
71 | eq: Boolean
72 | }
73 |
74 | input ModelTodoFilterInput {
75 | id: ModelIDFilterInput
76 | name: ModelStringFilterInput
77 | description: ModelStringFilterInput
78 | time: ModelStringFilterInput
79 | completed: ModelBooleanFilterInput
80 | and: [ModelTodoFilterInput]
81 | or: [ModelTodoFilterInput]
82 | not: ModelTodoFilterInput
83 | }
84 |
85 | type Query {
86 | getTodo(id: ID!): Todo
87 | listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection
88 | }
89 |
90 | input CreateTodoInput {
91 | id: ID
92 | name: String!
93 | description: String
94 | time: String
95 | completed: Boolean
96 | }
97 |
98 | input UpdateTodoInput {
99 | id: ID!
100 | name: String
101 | description: String
102 | time: String
103 | completed: Boolean
104 | }
105 |
106 | input DeleteTodoInput {
107 | id: ID
108 | }
109 |
110 | type Mutation {
111 | createTodo(input: CreateTodoInput!): Todo
112 | updateTodo(input: UpdateTodoInput!): Todo
113 | deleteTodo(input: DeleteTodoInput!): Todo
114 | }
115 |
116 | type Subscription {
117 | onCreateTodo: Todo @aws_subscribe(mutations: ["createTodo"])
118 | onUpdateTodo: Todo @aws_subscribe(mutations: ["updateTodo"])
119 | onDeleteTodo: Todo @aws_subscribe(mutations: ["deleteTodo"])
120 | }
121 |
--------------------------------------------------------------------------------
/amplify/#current-cloud-backend/api/todoApi/schema.graphql:
--------------------------------------------------------------------------------
1 | type Todo @model {
2 | id: ID!
3 | name: String!
4 | description: String
5 | time: String
6 | completed: Boolean
7 |
8 | }
--------------------------------------------------------------------------------
/amplify/#current-cloud-backend/backend-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "api": {
3 | "todoApi": {
4 | "service": "AppSync",
5 | "providerPlugin": "awscloudformation",
6 | "output": {
7 | "authConfig": {
8 | "additionalAuthenticationProviders": [],
9 | "defaultAuthentication": {
10 | "authenticationType": "API_KEY",
11 | "apiKeyConfig": {
12 | "description": "API key desc",
13 | "apiKeyExpirationDays": 180
14 | }
15 | }
16 | }
17 | }
18 | }
19 | },
20 | "auth": {
21 | "amplifyprojectb3fea6ea": {
22 | "service": "Cognito",
23 | "providerPlugin": "awscloudformation",
24 | "dependsOn": []
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/amplify/backend/amplify-meta.json:
--------------------------------------------------------------------------------
1 | {
2 | "providers": {
3 | "awscloudformation": {
4 | "AuthRoleName": "amplifyproject-test-20190919143906-authRole",
5 | "UnauthRoleArn": "arn:aws:iam::082042224423:role/amplifyproject-test-20190919143906-unauthRole",
6 | "AuthRoleArn": "arn:aws:iam::082042224423:role/amplifyproject-test-20190919143906-authRole",
7 | "Region": "us-east-1",
8 | "DeploymentBucketName": "amplifyproject-test-20190919143906-deployment",
9 | "UnauthRoleName": "amplifyproject-test-20190919143906-unauthRole",
10 | "StackName": "amplifyproject-test-20190919143906",
11 | "StackId": "arn:aws:cloudformation:us-east-1:082042224423:stack/amplifyproject-test-20190919143906/17196b80-dad2-11e9-a39a-0e8cd4caae34"
12 | }
13 | },
14 | "api": {
15 | "todoApi": {
16 | "service": "AppSync",
17 | "providerPlugin": "awscloudformation",
18 | "output": {
19 | "authConfig": {
20 | "additionalAuthenticationProviders": [],
21 | "defaultAuthentication": {
22 | "authenticationType": "API_KEY",
23 | "apiKeyConfig": {
24 | "description": "API key desc",
25 | "apiKeyExpirationDays": 180
26 | }
27 | }
28 | },
29 | "GraphQLAPIIdOutput": "uuhw536vujaphbrqpfajkp32nm",
30 | "GraphQLAPIEndpointOutput": "https://6oqacvdcd5ehbkhflibujnjzpy.appsync-api.us-east-1.amazonaws.com/graphql",
31 | "GraphQLAPIKeyOutput": "da2-iawhwbfha5c3dhf3efuwpxphxy"
32 | },
33 | "providerMetadata": {
34 | "s3TemplateURL": "https://s3.amazonaws.com/amplifyproject-test-20190919143906-deployment/amplify-cfn-templates/api/cloudformation-template.json",
35 | "logicalId": "apitodoApi"
36 | },
37 | "lastPushTimeStamp": "2019-10-01T09:09:30.142Z",
38 | "lastPushDirHash": "mxXk6l5KNOtkouTdh7lzbjTwibM="
39 | }
40 | },
41 | "auth": {
42 | "amplifyprojectb3fea6ea": {
43 | "service": "Cognito",
44 | "providerPlugin": "awscloudformation",
45 | "dependsOn": [],
46 | "providerMetadata": {
47 | "s3TemplateURL": "https://s3.amazonaws.com/amplifyproject-test-20190919143906-deployment/amplify-cfn-templates/auth/amplifyprojectb3fea6ea-cloudformation-template.yml",
48 | "logicalId": "authamplifyprojectb3fea6ea"
49 | },
50 | "lastPushTimeStamp": "2019-10-01T09:09:30.144Z",
51 | "output": {
52 | "AppClientSecret": "eq1842m668qrllirihf2ef9du1tpgg4h253oujo5plc4vdilbqd",
53 | "UserPoolId": "us-east-1_JEGRSXJ1m",
54 | "AppClientIDWeb": "1siqsh7nie77r156gmpve4bdh5",
55 | "AppClientID": "30mmpk81nmdg900fqci2fr2jqi",
56 | "HostedUIDomain": "amplifyprojectb3fea6ea-b3fea6ea-test",
57 | "IdentityPoolId": "us-east-1:4b34cfd5-e707-4432-9a9c-49a6b2eb4723",
58 | "IdentityPoolName": "amplifyprojectb3fea6ea_identitypool_b3fea6ea__test",
59 | "OAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"https://192.168.0.80:19006/\"],\"LogoutURLs\":[\"https://192.168.0.80:19006/\"]}",
60 | "UserPoolName": "amplifyprojectb3fea6ea_userpool_b3fea6ea"
61 | },
62 | "lastPushDirHash": "CIyQxc9lLwnKX9iCcKX/cNkb+3s="
63 | }
64 | }
65 | }
--------------------------------------------------------------------------------
/amplify/backend/api/todoApi/build/cloudformation-template.json:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion": "2010-09-09",
3 | "Description": "An auto-generated nested stack.",
4 | "Metadata": {},
5 | "Parameters": {
6 | "DynamoDBModelTableReadIOPS": {
7 | "Type": "Number",
8 | "Description": "The number of read IOPS the table should support.",
9 | "Default": 5
10 | },
11 | "DynamoDBModelTableWriteIOPS": {
12 | "Type": "Number",
13 | "Description": "The number of write IOPS the table should support.",
14 | "Default": 5
15 | },
16 | "DynamoDBBillingMode": {
17 | "Type": "String",
18 | "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes.",
19 | "Default": "PAY_PER_REQUEST",
20 | "AllowedValues": [
21 | "PAY_PER_REQUEST",
22 | "PROVISIONED"
23 | ]
24 | },
25 | "DynamoDBEnablePointInTimeRecovery": {
26 | "Type": "String",
27 | "Description": "Whether to enable Point in Time Recovery on the table",
28 | "Default": "false",
29 | "AllowedValues": [
30 | "true",
31 | "false"
32 | ]
33 | },
34 | "DynamoDBEnableServerSideEncryption": {
35 | "Type": "String",
36 | "Description": "Enable server side encryption powered by KMS.",
37 | "Default": "true",
38 | "AllowedValues": [
39 | "true",
40 | "false"
41 | ]
42 | },
43 | "AppSyncApiName": {
44 | "Type": "String",
45 | "Description": "The name of the AppSync API",
46 | "Default": "AppSyncSimpleTransform"
47 | },
48 | "APIKeyExpirationEpoch": {
49 | "Type": "Number",
50 | "Description": "The epoch time in seconds when the API Key should expire. Setting this to 0 will default to 180 days from the deployment date. Setting this to -1 will not create an API Key.",
51 | "Default": 0,
52 | "MinValue": -1
53 | },
54 | "CreateAPIKey": {
55 | "Type": "Number",
56 | "Description": "The boolean value to control if an API Key will be created or not. The value of the property is automatically set by the CLI. If the value is set to 0 no API Key will be created.",
57 | "Default": 0,
58 | "MinValue": 0,
59 | "MaxValue": 1
60 | },
61 | "AuthCognitoUserPoolId": {
62 | "Type": "String",
63 | "Description": "The id of an existing User Pool to connect. If this is changed, a user pool will not be created for you.",
64 | "Default": "NONE"
65 | },
66 | "env": {
67 | "Type": "String",
68 | "Description": "The environment name. e.g. Dev, Test, or Production",
69 | "Default": "NONE"
70 | },
71 | "S3DeploymentBucket": {
72 | "Type": "String",
73 | "Description": "The S3 bucket containing all deployment assets for the project."
74 | },
75 | "S3DeploymentRootKey": {
76 | "Type": "String",
77 | "Description": "An S3 key relative to the S3DeploymentBucket that points to the root of the deployment directory."
78 | }
79 | },
80 | "Resources": {
81 | "GraphQLAPI": {
82 | "Type": "AWS::AppSync::GraphQLApi",
83 | "Properties": {
84 | "Name": {
85 | "Fn::If": [
86 | "HasEnvironmentParameter",
87 | {
88 | "Fn::Join": [
89 | "-",
90 | [
91 | {
92 | "Ref": "AppSyncApiName"
93 | },
94 | {
95 | "Ref": "env"
96 | }
97 | ]
98 | ]
99 | },
100 | {
101 | "Ref": "AppSyncApiName"
102 | }
103 | ]
104 | },
105 | "AuthenticationType": "API_KEY"
106 | }
107 | },
108 | "GraphQLAPIKey": {
109 | "Type": "AWS::AppSync::ApiKey",
110 | "Properties": {
111 | "ApiId": {
112 | "Fn::GetAtt": [
113 | "GraphQLAPI",
114 | "ApiId"
115 | ]
116 | },
117 | "Description": "API key desc",
118 | "Expires": {
119 | "Fn::If": [
120 | "APIKeyExpirationEpochIsPositive",
121 | {
122 | "Ref": "APIKeyExpirationEpoch"
123 | },
124 | 1584889985
125 | ]
126 | }
127 | },
128 | "Condition": "ShouldCreateAPIKey"
129 | },
130 | "GraphQLSchema": {
131 | "Type": "AWS::AppSync::GraphQLSchema",
132 | "Properties": {
133 | "ApiId": {
134 | "Fn::GetAtt": [
135 | "GraphQLAPI",
136 | "ApiId"
137 | ]
138 | },
139 | "DefinitionS3Location": {
140 | "Fn::Sub": [
141 | "s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/schema.graphql",
142 | {
143 | "S3DeploymentBucket": {
144 | "Ref": "S3DeploymentBucket"
145 | },
146 | "S3DeploymentRootKey": {
147 | "Ref": "S3DeploymentRootKey"
148 | }
149 | }
150 | ]
151 | }
152 | }
153 | },
154 | "Todo": {
155 | "Type": "AWS::CloudFormation::Stack",
156 | "Properties": {
157 | "Parameters": {
158 | "AppSyncApiId": {
159 | "Fn::GetAtt": [
160 | "GraphQLAPI",
161 | "ApiId"
162 | ]
163 | },
164 | "DynamoDBModelTableReadIOPS": {
165 | "Ref": "DynamoDBModelTableReadIOPS"
166 | },
167 | "DynamoDBModelTableWriteIOPS": {
168 | "Ref": "DynamoDBModelTableWriteIOPS"
169 | },
170 | "DynamoDBBillingMode": {
171 | "Ref": "DynamoDBBillingMode"
172 | },
173 | "DynamoDBEnablePointInTimeRecovery": {
174 | "Ref": "DynamoDBEnablePointInTimeRecovery"
175 | },
176 | "DynamoDBEnableServerSideEncryption": {
177 | "Ref": "DynamoDBEnableServerSideEncryption"
178 | },
179 | "AppSyncApiName": {
180 | "Ref": "AppSyncApiName"
181 | },
182 | "APIKeyExpirationEpoch": {
183 | "Ref": "APIKeyExpirationEpoch"
184 | },
185 | "CreateAPIKey": {
186 | "Ref": "CreateAPIKey"
187 | },
188 | "AuthCognitoUserPoolId": {
189 | "Ref": "AuthCognitoUserPoolId"
190 | },
191 | "env": {
192 | "Ref": "env"
193 | },
194 | "S3DeploymentBucket": {
195 | "Ref": "S3DeploymentBucket"
196 | },
197 | "S3DeploymentRootKey": {
198 | "Ref": "S3DeploymentRootKey"
199 | },
200 | "GetAttGraphQLAPIApiId": {
201 | "Fn::GetAtt": [
202 | "GraphQLAPI",
203 | "ApiId"
204 | ]
205 | }
206 | },
207 | "TemplateURL": {
208 | "Fn::Join": [
209 | "/",
210 | [
211 | "https://s3.amazonaws.com",
212 | {
213 | "Ref": "S3DeploymentBucket"
214 | },
215 | {
216 | "Ref": "S3DeploymentRootKey"
217 | },
218 | "stacks",
219 | "Todo.json"
220 | ]
221 | ]
222 | }
223 | },
224 | "DependsOn": [
225 | "GraphQLSchema"
226 | ]
227 | },
228 | "CustomResourcesjson": {
229 | "Type": "AWS::CloudFormation::Stack",
230 | "Properties": {
231 | "Parameters": {
232 | "AppSyncApiId": {
233 | "Fn::GetAtt": [
234 | "GraphQLAPI",
235 | "ApiId"
236 | ]
237 | },
238 | "AppSyncApiName": {
239 | "Ref": "AppSyncApiName"
240 | },
241 | "env": {
242 | "Ref": "env"
243 | },
244 | "S3DeploymentBucket": {
245 | "Ref": "S3DeploymentBucket"
246 | },
247 | "S3DeploymentRootKey": {
248 | "Ref": "S3DeploymentRootKey"
249 | }
250 | },
251 | "TemplateURL": {
252 | "Fn::Join": [
253 | "/",
254 | [
255 | "https://s3.amazonaws.com",
256 | {
257 | "Ref": "S3DeploymentBucket"
258 | },
259 | {
260 | "Ref": "S3DeploymentRootKey"
261 | },
262 | "stacks",
263 | "CustomResources.json"
264 | ]
265 | ]
266 | }
267 | },
268 | "DependsOn": [
269 | "GraphQLAPI",
270 | "GraphQLSchema",
271 | "Todo"
272 | ]
273 | }
274 | },
275 | "Outputs": {
276 | "GraphQLAPIIdOutput": {
277 | "Description": "Your GraphQL API ID.",
278 | "Value": {
279 | "Fn::GetAtt": [
280 | "GraphQLAPI",
281 | "ApiId"
282 | ]
283 | },
284 | "Export": {
285 | "Name": {
286 | "Fn::Join": [
287 | ":",
288 | [
289 | {
290 | "Ref": "AWS::StackName"
291 | },
292 | "GraphQLApiId"
293 | ]
294 | ]
295 | }
296 | }
297 | },
298 | "GraphQLAPIEndpointOutput": {
299 | "Description": "Your GraphQL API endpoint.",
300 | "Value": {
301 | "Fn::GetAtt": [
302 | "GraphQLAPI",
303 | "GraphQLUrl"
304 | ]
305 | },
306 | "Export": {
307 | "Name": {
308 | "Fn::Join": [
309 | ":",
310 | [
311 | {
312 | "Ref": "AWS::StackName"
313 | },
314 | "GraphQLApiEndpoint"
315 | ]
316 | ]
317 | }
318 | }
319 | },
320 | "GraphQLAPIKeyOutput": {
321 | "Description": "Your GraphQL API key. Provide via 'x-api-key' header.",
322 | "Value": {
323 | "Fn::GetAtt": [
324 | "GraphQLAPIKey",
325 | "ApiKey"
326 | ]
327 | },
328 | "Export": {
329 | "Name": {
330 | "Fn::Join": [
331 | ":",
332 | [
333 | {
334 | "Ref": "AWS::StackName"
335 | },
336 | "GraphQLApiKey"
337 | ]
338 | ]
339 | }
340 | },
341 | "Condition": "ShouldCreateAPIKey"
342 | }
343 | },
344 | "Conditions": {
345 | "ShouldUsePayPerRequestBilling": {
346 | "Fn::Equals": [
347 | {
348 | "Ref": "DynamoDBBillingMode"
349 | },
350 | "PAY_PER_REQUEST"
351 | ]
352 | },
353 | "ShouldUsePointInTimeRecovery": {
354 | "Fn::Equals": [
355 | {
356 | "Ref": "DynamoDBEnablePointInTimeRecovery"
357 | },
358 | "true"
359 | ]
360 | },
361 | "ShouldUseServerSideEncryption": {
362 | "Fn::Equals": [
363 | {
364 | "Ref": "DynamoDBEnableServerSideEncryption"
365 | },
366 | "true"
367 | ]
368 | },
369 | "ShouldCreateAPIKey": {
370 | "Fn::Equals": [
371 | {
372 | "Ref": "CreateAPIKey"
373 | },
374 | 1
375 | ]
376 | },
377 | "APIKeyExpirationEpochIsPositive": {
378 | "Fn::And": [
379 | {
380 | "Fn::Not": [
381 | {
382 | "Fn::Equals": [
383 | {
384 | "Ref": "APIKeyExpirationEpoch"
385 | },
386 | -1
387 | ]
388 | }
389 | ]
390 | },
391 | {
392 | "Fn::Not": [
393 | {
394 | "Fn::Equals": [
395 | {
396 | "Ref": "APIKeyExpirationEpoch"
397 | },
398 | 0
399 | ]
400 | }
401 | ]
402 | }
403 | ]
404 | },
405 | "HasEnvironmentParameter": {
406 | "Fn::Not": [
407 | {
408 | "Fn::Equals": [
409 | {
410 | "Ref": "env"
411 | },
412 | "NONE"
413 | ]
414 | }
415 | ]
416 | }
417 | }
418 | }
--------------------------------------------------------------------------------
/amplify/backend/api/todoApi/build/parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "CreateAPIKey": 1,
3 | "AppSyncApiName": "todoApi",
4 | "DynamoDBBillingMode": "PAY_PER_REQUEST",
5 | "DynamoDBEnableServerSideEncryption": "false",
6 | "S3DeploymentBucket": "amplifyproject-test-20190919143906-deployment",
7 | "S3DeploymentRootKey": "amplify-appsync-files/4b4b159fa3fedb4ab8ed48d581bcb35cf038c826"
8 | }
--------------------------------------------------------------------------------
/amplify/backend/api/todoApi/build/schema.graphql:
--------------------------------------------------------------------------------
1 | type Todo {
2 | id: ID!
3 | name: String!
4 | description: String
5 | time: String
6 | completed: Boolean
7 | }
8 |
9 | enum ModelSortDirection {
10 | ASC
11 | DESC
12 | }
13 |
14 | type ModelTodoConnection {
15 | items: [Todo]
16 | nextToken: String
17 | }
18 |
19 | input ModelStringFilterInput {
20 | ne: String
21 | eq: String
22 | le: String
23 | lt: String
24 | ge: String
25 | gt: String
26 | contains: String
27 | notContains: String
28 | between: [String]
29 | beginsWith: String
30 | }
31 |
32 | input ModelIDFilterInput {
33 | ne: ID
34 | eq: ID
35 | le: ID
36 | lt: ID
37 | ge: ID
38 | gt: ID
39 | contains: ID
40 | notContains: ID
41 | between: [ID]
42 | beginsWith: ID
43 | }
44 |
45 | input ModelIntFilterInput {
46 | ne: Int
47 | eq: Int
48 | le: Int
49 | lt: Int
50 | ge: Int
51 | gt: Int
52 | contains: Int
53 | notContains: Int
54 | between: [Int]
55 | }
56 |
57 | input ModelFloatFilterInput {
58 | ne: Float
59 | eq: Float
60 | le: Float
61 | lt: Float
62 | ge: Float
63 | gt: Float
64 | contains: Float
65 | notContains: Float
66 | between: [Float]
67 | }
68 |
69 | input ModelBooleanFilterInput {
70 | ne: Boolean
71 | eq: Boolean
72 | }
73 |
74 | input ModelTodoFilterInput {
75 | id: ModelIDFilterInput
76 | name: ModelStringFilterInput
77 | description: ModelStringFilterInput
78 | time: ModelStringFilterInput
79 | completed: ModelBooleanFilterInput
80 | and: [ModelTodoFilterInput]
81 | or: [ModelTodoFilterInput]
82 | not: ModelTodoFilterInput
83 | }
84 |
85 | type Query {
86 | getTodo(id: ID!): Todo
87 | listTodos(filter: ModelTodoFilterInput, limit: Int, nextToken: String): ModelTodoConnection
88 | }
89 |
90 | input CreateTodoInput {
91 | id: ID
92 | name: String!
93 | description: String
94 | time: String
95 | completed: Boolean
96 | }
97 |
98 | input UpdateTodoInput {
99 | id: ID!
100 | name: String
101 | description: String
102 | time: String
103 | completed: Boolean
104 | }
105 |
106 | input DeleteTodoInput {
107 | id: ID
108 | }
109 |
110 | type Mutation {
111 | createTodo(input: CreateTodoInput!): Todo
112 | updateTodo(input: UpdateTodoInput!): Todo
113 | deleteTodo(input: DeleteTodoInput!): Todo
114 | }
115 |
116 | type Subscription {
117 | onCreateTodo: Todo @aws_subscribe(mutations: ["createTodo"])
118 | onUpdateTodo: Todo @aws_subscribe(mutations: ["updateTodo"])
119 | onDeleteTodo: Todo @aws_subscribe(mutations: ["deleteTodo"])
120 | }
121 |
--------------------------------------------------------------------------------
/amplify/backend/api/todoApi/schema.graphql:
--------------------------------------------------------------------------------
1 | type Todo @model {
2 | id: ID!
3 | name: String!
4 | description: String
5 | time: String
6 | completed: Boolean
7 |
8 | }
--------------------------------------------------------------------------------
/amplify/backend/auth/amplifyprojectb3fea6ea/amplifyprojectb3fea6ea-cloudformation-template.yml:
--------------------------------------------------------------------------------
1 | AWSTemplateFormatVersion: 2010-09-09
2 |
3 | Parameters:
4 | env:
5 | Type: String
6 | authRoleArn:
7 | Type: String
8 | unauthRoleArn:
9 | Type: String
10 |
11 |
12 |
13 |
14 | identityPoolName:
15 | Type: String
16 |
17 | allowUnauthenticatedIdentities:
18 | Type: String
19 |
20 | resourceNameTruncated:
21 | Type: String
22 |
23 | userPoolName:
24 | Type: String
25 |
26 | autoVerifiedAttributes:
27 | Type: CommaDelimitedList
28 |
29 | mfaConfiguration:
30 | Type: String
31 |
32 | mfaTypes:
33 | Type: CommaDelimitedList
34 |
35 | smsAuthenticationMessage:
36 | Type: String
37 |
38 | smsVerificationMessage:
39 | Type: String
40 |
41 | emailVerificationSubject:
42 | Type: String
43 |
44 | emailVerificationMessage:
45 | Type: String
46 |
47 | defaultPasswordPolicy:
48 | Type: String
49 |
50 | passwordPolicyMinLength:
51 | Type: Number
52 |
53 | passwordPolicyCharacters:
54 | Type: CommaDelimitedList
55 |
56 | requiredAttributes:
57 | Type: CommaDelimitedList
58 |
59 | userpoolClientGenerateSecret:
60 | Type: String
61 |
62 | userpoolClientRefreshTokenValidity:
63 | Type: Number
64 |
65 | userpoolClientWriteAttributes:
66 | Type: CommaDelimitedList
67 |
68 | userpoolClientReadAttributes:
69 | Type: CommaDelimitedList
70 |
71 | userpoolClientLambdaRole:
72 | Type: String
73 |
74 | userpoolClientSetAttributes:
75 | Type: String
76 |
77 | resourceName:
78 | Type: String
79 |
80 | authSelections:
81 | Type: String
82 |
83 | useDefault:
84 | Type: String
85 |
86 | hostedUI:
87 | Type: String
88 |
89 | hostedUIDomainName:
90 | Type: String
91 |
92 | authProvidersUserPool:
93 | Type: CommaDelimitedList
94 |
95 | hostedUIProviderMeta:
96 | Type: String
97 |
98 | hostedUIProviderCreds:
99 | Type: String
100 |
101 | oAuthMetadata:
102 | Type: String
103 |
104 | dependsOn:
105 | Type: CommaDelimitedList
106 |
107 | Conditions:
108 | ShouldNotCreateEnvResources: !Equals [ !Ref env, NONE ]
109 |
110 | Resources:
111 |
112 |
113 | # BEGIN SNS ROLE RESOURCE
114 | SNSRole:
115 | # Created to allow the UserPool SMS Config to publish via the Simple Notification Service during MFA Process
116 | Type: AWS::IAM::Role
117 | Properties:
118 | RoleName: !If [ShouldNotCreateEnvResources, 'amplifb3fea6ea_sns-role', !Join ['',['amplifb3fea6ea_sns-role', '-', !Ref env]]]
119 | AssumeRolePolicyDocument:
120 | Version: "2012-10-17"
121 | Statement:
122 | - Sid: ""
123 | Effect: "Allow"
124 | Principal:
125 | Service: "cognito-idp.amazonaws.com"
126 | Action:
127 | - "sts:AssumeRole"
128 | Condition:
129 | StringEquals:
130 | sts:ExternalId: amplifb3fea6ea_role_external_id
131 | Policies:
132 | -
133 | PolicyName: amplifb3fea6ea-sns-policy
134 | PolicyDocument:
135 | Version: "2012-10-17"
136 | Statement:
137 | -
138 | Effect: "Allow"
139 | Action:
140 | - "sns:Publish"
141 | Resource: "*"
142 | # BEGIN USER POOL RESOURCES
143 | UserPool:
144 | # Created upon user selection
145 | # Depends on SNS Role for Arn if MFA is enabled
146 | Type: AWS::Cognito::UserPool
147 | UpdateReplacePolicy: Retain
148 | Properties:
149 | UserPoolName: !If [ShouldNotCreateEnvResources, !Ref userPoolName, !Join ['',[!Ref userPoolName, '-', !Ref env]]]
150 |
151 | Schema:
152 |
153 | -
154 | Name: email
155 | Required: true
156 | Mutable: true
157 |
158 |
159 |
160 |
161 | AutoVerifiedAttributes: !Ref autoVerifiedAttributes
162 |
163 |
164 | EmailVerificationMessage: !Ref emailVerificationMessage
165 | EmailVerificationSubject: !Ref emailVerificationSubject
166 |
167 | Policies:
168 | PasswordPolicy:
169 | MinimumLength: !Ref passwordPolicyMinLength
170 | RequireLowercase: false
171 | RequireNumbers: false
172 | RequireSymbols: false
173 | RequireUppercase: false
174 |
175 | MfaConfiguration: !Ref mfaConfiguration
176 | SmsVerificationMessage: !Ref smsVerificationMessage
177 | SmsConfiguration:
178 | SnsCallerArn: !GetAtt SNSRole.Arn
179 | ExternalId: amplifb3fea6ea_role_external_id
180 |
181 |
182 | UserPoolClientWeb:
183 | # Created provide application access to user pool
184 | # Depends on UserPool for ID reference
185 | Type: "AWS::Cognito::UserPoolClient"
186 | Properties:
187 | ClientName: amplifb3fea6ea_app_clientWeb
188 |
189 | RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
190 | UserPoolId: !Ref UserPool
191 | DependsOn: UserPool
192 | UserPoolClient:
193 | # Created provide application access to user pool
194 | # Depends on UserPool for ID reference
195 | Type: "AWS::Cognito::UserPoolClient"
196 | Properties:
197 | ClientName: amplifb3fea6ea_app_client
198 |
199 | GenerateSecret: !Ref userpoolClientGenerateSecret
200 | RefreshTokenValidity: !Ref userpoolClientRefreshTokenValidity
201 | UserPoolId: !Ref UserPool
202 | DependsOn: UserPool
203 | # BEGIN USER POOL LAMBDA RESOURCES
204 | UserPoolClientRole:
205 | # Created to execute Lambda which gets userpool app client config values
206 | Type: 'AWS::IAM::Role'
207 | Properties:
208 | RoleName: !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
209 | AssumeRolePolicyDocument:
210 | Version: '2012-10-17'
211 | Statement:
212 | - Effect: Allow
213 | Principal:
214 | Service:
215 | - lambda.amazonaws.com
216 | Action:
217 | - 'sts:AssumeRole'
218 | DependsOn: UserPoolClient
219 | UserPoolClientLambda:
220 | # Lambda which gets userpool app client config values
221 | # Depends on UserPool for id
222 | # Depends on UserPoolClientRole for role ARN
223 | Type: 'AWS::Lambda::Function'
224 | Properties:
225 | Code:
226 | ZipFile: !Join
227 | - |+
228 | - - 'const response = require(''cfn-response'');'
229 | - 'const aws = require(''aws-sdk'');'
230 | - 'const identity = new aws.CognitoIdentityServiceProvider();'
231 | - 'exports.handler = (event, context, callback) => {'
232 | - ' if (event.RequestType == ''Delete'') { '
233 | - ' response.send(event, context, response.SUCCESS, {})'
234 | - ' }'
235 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
236 | - ' const params = {'
237 | - ' ClientId: event.ResourceProperties.clientId,'
238 | - ' UserPoolId: event.ResourceProperties.userpoolId'
239 | - ' };'
240 | - ' identity.describeUserPoolClient(params).promise()'
241 | - ' .then((res) => {'
242 | - ' response.send(event, context, response.SUCCESS, {''appSecret'': res.UserPoolClient.ClientSecret});'
243 | - ' })'
244 | - ' .catch((err) => {'
245 | - ' response.send(event, context, response.FAILED, {err});'
246 | - ' });'
247 | - ' }'
248 | - '};'
249 | Handler: index.handler
250 | Runtime: nodejs8.10
251 | Timeout: '300'
252 | Role: !GetAtt
253 | - UserPoolClientRole
254 | - Arn
255 | DependsOn: UserPoolClientRole
256 | UserPoolClientLambdaPolicy:
257 | # Sets userpool policy for the role that executes the Userpool Client Lambda
258 | # Depends on UserPool for Arn
259 | # Marked as depending on UserPoolClientRole for easier to understand CFN sequencing
260 | Type: 'AWS::IAM::Policy'
261 | Properties:
262 | PolicyName: amplifb3fea6ea_userpoolclient_lambda_iam_policy
263 | Roles:
264 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
265 | PolicyDocument:
266 | Version: '2012-10-17'
267 | Statement:
268 | - Effect: Allow
269 | Action:
270 | - 'cognito-idp:DescribeUserPoolClient'
271 | Resource: !GetAtt UserPool.Arn
272 | DependsOn: UserPoolClientLambda
273 | UserPoolClientLogPolicy:
274 | # Sets log policy for the role that executes the Userpool Client Lambda
275 | # Depends on UserPool for Arn
276 | # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
277 | Type: 'AWS::IAM::Policy'
278 | Properties:
279 | PolicyName: amplifb3fea6ea_userpoolclient_lambda_log_policy
280 | Roles:
281 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
282 | PolicyDocument:
283 | Version: 2012-10-17
284 | Statement:
285 | - Effect: Allow
286 | Action:
287 | - 'logs:CreateLogGroup'
288 | - 'logs:CreateLogStream'
289 | - 'logs:PutLogEvents'
290 | Resource: !Sub
291 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
292 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref UserPoolClientLambda}
293 | DependsOn: UserPoolClientLambdaPolicy
294 | UserPoolClientInputs:
295 | # Values passed to Userpool client Lambda
296 | # Depends on UserPool for Id
297 | # Depends on UserPoolClient for Id
298 | # Marked as depending on UserPoolClientLambdaPolicy for easier to understand CFN sequencing
299 | Type: 'Custom::LambdaCallout'
300 | Properties:
301 | ServiceToken: !GetAtt UserPoolClientLambda.Arn
302 | clientId: !Ref UserPoolClient
303 | userpoolId: !Ref UserPool
304 | DependsOn: UserPoolClientLogPolicy
305 |
306 | HostedUICustomResource:
307 | Type: 'AWS::Lambda::Function'
308 | Properties:
309 | Code:
310 | ZipFile: !Join
311 | - |+
312 | - - 'const response = require(''cfn-response'');'
313 | - 'const aws = require(''aws-sdk'');'
314 | - 'const identity = new aws.CognitoIdentityServiceProvider();'
315 | - 'exports.handler = (event, context, callback) => {'
316 | - ' const userPoolId = event.ResourceProperties.userPoolId;'
317 | - ' const inputDomainName = event.ResourceProperties.hostedUIDomainName;'
318 | - ' let deleteUserPoolDomain = (domainName) => {'
319 | - ' let params = { Domain: domainName, UserPoolId: userPoolId };'
320 | - ' return identity.deleteUserPoolDomain(params).promise();'
321 | - ' };'
322 | - ' if (event.RequestType == ''Delete'') {'
323 | - ' deleteUserPoolDomain(inputDomainName)'
324 | - ' .then(() => {response.send(event, context, response.SUCCESS, {})})'
325 | - ' .catch((err) => { console.log(err); response.send(event, context, response.FAILED, {err}) });'
326 | - ' }'
327 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
328 | - ' let checkDomainAvailability = (domainName) => {'
329 | - ' let params = { Domain: domainName };'
330 | - ' return identity.describeUserPoolDomain(params).promise().then((res) => {'
331 | - ' if (res.DomainDescription && res.DomainDescription.UserPool) {'
332 | - ' return false;'
333 | - ' }'
334 | - ' return true;'
335 | - ' }).catch((err) => { return false; });'
336 | - ' };'
337 | - ' let createUserPoolDomain = (domainName) => {'
338 | - ' let params = { Domain: domainName, UserPoolId: userPoolId };'
339 | - ' return identity.createUserPoolDomain(params).promise();'
340 | - ' };'
341 | - ' identity.describeUserPool({UserPoolId: userPoolId }).promise().then((result) => {'
342 | - ' if (inputDomainName) {'
343 | - ' if (result.UserPool.Domain === inputDomainName) {'
344 | - ' return;'
345 | - ' } else {'
346 | - ' if (!result.UserPool.Domain) {'
347 | - ' return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {'
348 | - ' if (isDomainAvailable) {'
349 | - ' return createUserPoolDomain(inputDomainName);'
350 | - ' } else {'
351 | - ' throw new Error(''Domain not available'');'
352 | - ' }'
353 | - ' });'
354 | - ' } else {'
355 | - ' return checkDomainAvailability(inputDomainName).then((isDomainAvailable) => {'
356 | - ' if (isDomainAvailable) {'
357 | - ' return deleteUserPoolDomain(result.UserPool.Domain).then(() => createUserPoolDomain(inputDomainName));'
358 | - ' } else {'
359 | - ' throw new Error(''Domain not available'');'
360 | - ' }'
361 | - ' });'
362 | - ' }'
363 | - ' }'
364 | - ' } else {'
365 | - ' if (result.UserPool.Domain) {'
366 | - ' return deleteUserPoolDomain(result.UserPool.Domain);'
367 | - ' }'
368 | - ' }'
369 | - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
370 | - ' console.log(err); response.send(event, context, response.FAILED, {err});'
371 | - ' });'
372 | - '}}'
373 |
374 |
375 | Handler: index.handler
376 | Runtime: nodejs8.10
377 | Timeout: '300'
378 | Role: !GetAtt
379 | - UserPoolClientRole
380 | - Arn
381 | DependsOn: UserPoolClientRole
382 |
383 | HostedUICustomResourcePolicy:
384 | Type: 'AWS::IAM::Policy'
385 | Properties:
386 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUI']]
387 | Roles:
388 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
389 | PolicyDocument:
390 | Version: '2012-10-17'
391 | Statement:
392 | - Effect: Allow
393 | Action:
394 | - 'cognito-idp:CreateUserPoolDomain'
395 | - 'cognito-idp:DescribeUserPool'
396 | - 'cognito-idp:DeleteUserPoolDomain'
397 | Resource: !GetAtt UserPool.Arn
398 | - Effect: Allow
399 | Action:
400 | - 'cognito-idp:DescribeUserPoolDomain'
401 | Resource: '*'
402 | DependsOn: HostedUICustomResource
403 | HostedUICustomResourceLogPolicy:
404 | Type: 'AWS::IAM::Policy'
405 | Properties:
406 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUILogPolicy']]
407 | Roles:
408 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
409 | PolicyDocument:
410 | Version: 2012-10-17
411 | Statement:
412 | - Effect: Allow
413 | Action:
414 | - 'logs:CreateLogGroup'
415 | - 'logs:CreateLogStream'
416 | - 'logs:PutLogEvents'
417 | Resource: !Sub
418 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
419 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref HostedUICustomResource}
420 | DependsOn: HostedUICustomResourcePolicy
421 | HostedUICustomResourceInputs:
422 | Type: 'Custom::LambdaCallout'
423 | Properties:
424 | ServiceToken: !GetAtt HostedUICustomResource.Arn
425 | userPoolId: !Ref UserPool
426 | hostedUIDomainName: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]]
427 | DependsOn: HostedUICustomResourceLogPolicy
428 |
429 |
430 |
431 | HostedUIProvidersCustomResource:
432 | Type: 'AWS::Lambda::Function'
433 | Properties:
434 | Code:
435 | ZipFile: !Join
436 | - |+
437 | - - 'const response = require(''cfn-response'');'
438 | - 'const aws = require(''aws-sdk'');'
439 | - 'const identity = new aws.CognitoIdentityServiceProvider();'
440 | - 'exports.handler = (event, context, callback) => {'
441 | - 'try{'
442 | - ' const userPoolId = event.ResourceProperties.userPoolId;'
443 | - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);'
444 | - ' let hostedUIProviderCreds = JSON.parse(event.ResourceProperties.hostedUIProviderCreds);'
445 | - ' if (event.RequestType == ''Delete'') {'
446 | - ' response.send(event, context, response.SUCCESS, {});'
447 | - ' }'
448 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
449 | - ' let getRequestParams = (providerName) => {'
450 | - ' let providerMetaIndex = hostedUIProviderMeta.findIndex((provider) => provider.ProviderName === providerName);'
451 | - ' let providerMeta = hostedUIProviderMeta[providerMetaIndex];'
452 | - ' let providerCredsIndex = hostedUIProviderCreds.findIndex((provider) => provider.ProviderName === providerName);'
453 | - ' let providerCreds = hostedUIProviderCreds[providerCredsIndex];'
454 | - ' let requestParams = {'
455 | - ' ProviderDetails: {'
456 | - ' ''client_id'': providerCreds.client_id,'
457 | - ' ''client_secret'': providerCreds.client_secret,'
458 | - ' ''authorize_scopes'': providerMeta.authorize_scopes'
459 | - ' },'
460 | - ' ProviderName: providerMeta.ProviderName,'
461 | - ' UserPoolId: userPoolId,'
462 | - ' AttributeMapping: providerMeta.AttributeMapping'
463 | - ' };'
464 | - ' return requestParams;'
465 | - ' };'
466 | - ' let createIdentityProvider = (providerName) => {'
467 | - ' let requestParams = getRequestParams(providerName);'
468 | - ' requestParams.ProviderType = requestParams.ProviderName;'
469 | - ' return identity.createIdentityProvider(requestParams).promise();'
470 | - ' };'
471 | - ' let updateIdentityProvider = (providerName) => {'
472 | - ' let requestParams = getRequestParams(providerName);'
473 | - ' return identity.updateIdentityProvider(requestParams).promise();'
474 | - ' };'
475 | - ' let deleteIdentityProvider = (providerName) => {'
476 | - ' let params = {ProviderName: providerName, UserPoolId: userPoolId};'
477 | - ' return identity.deleteIdentityProvider(params).promise();'
478 | - ' };'
479 | - ' let providerPromises = [];'
480 | - ' identity.listIdentityProviders({UserPoolId: userPoolId, MaxResults: 60}).promise()'
481 | - ' .then((result) => {'
482 | - ' let providerList = result.Providers.map(provider => provider.ProviderName);'
483 | - ' let providerListInParameters = hostedUIProviderMeta.map(provider => provider.ProviderName);'
484 | - ' hostedUIProviderMeta.forEach((providerMetadata) => {'
485 | - ' if(providerList.indexOf(providerMetadata.ProviderName) > -1) {'
486 | - ' providerPromises.push(updateIdentityProvider(providerMetadata.ProviderName));'
487 | - ' } else {'
488 | - ' providerPromises.push(createIdentityProvider(providerMetadata.ProviderName));'
489 | - ' }'
490 | - ' });'
491 | - ' providerList.forEach((provider) => {'
492 | - ' if(providerListInParameters.indexOf(provider) < 0) {'
493 | - ' providerPromises.push(deleteIdentityProvider(provider));'
494 | - ' }'
495 | - ' });'
496 | - ' return Promise.all(providerPromises);'
497 | - ' }).then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
498 | - ' console.log(err.stack); response.send(event, context, response.FAILED, {err})'
499 | - ' });'
500 | - ' } '
501 | - ' } catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};'
502 | - '} '
503 |
504 | Handler: index.handler
505 | Runtime: nodejs8.10
506 | Timeout: '300'
507 | Role: !GetAtt
508 | - UserPoolClientRole
509 | - Arn
510 | DependsOn: UserPoolClientRole
511 |
512 | HostedUIProvidersCustomResourcePolicy:
513 | Type: 'AWS::IAM::Policy'
514 | Properties:
515 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProvider']]
516 | Roles:
517 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
518 | PolicyDocument:
519 | Version: '2012-10-17'
520 | Statement:
521 | - Effect: Allow
522 | Action:
523 | - 'cognito-idp:CreateIdentityProvider'
524 | - 'cognito-idp:UpdateIdentityProvider'
525 | - 'cognito-idp:ListIdentityProviders'
526 | - 'cognito-idp:DeleteIdentityProvider'
527 | Resource: !GetAtt UserPool.Arn
528 | DependsOn: HostedUIProvidersCustomResource
529 |
530 | HostedUIProvidersCustomResourceLogPolicy:
531 | Type: 'AWS::IAM::Policy'
532 | Properties:
533 | PolicyName: !Join ['-',[!Ref UserPool, 'hostedUIProviderLogPolicy']]
534 | Roles:
535 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
536 | PolicyDocument:
537 | Version: 2012-10-17
538 | Statement:
539 | - Effect: Allow
540 | Action:
541 | - 'logs:CreateLogGroup'
542 | - 'logs:CreateLogStream'
543 | - 'logs:PutLogEvents'
544 | Resource: !Sub
545 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
546 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref HostedUIProvidersCustomResource}
547 | DependsOn: HostedUIProvidersCustomResourcePolicy
548 |
549 | HostedUIProvidersCustomResourceInputs:
550 | Type: 'Custom::LambdaCallout'
551 | Properties:
552 | ServiceToken: !GetAtt HostedUIProvidersCustomResource.Arn
553 | userPoolId: !Ref UserPool
554 | hostedUIProviderMeta: !Ref hostedUIProviderMeta
555 | hostedUIProviderCreds: !Ref hostedUIProviderCreds
556 | DependsOn: HostedUIProvidersCustomResourceLogPolicy
557 |
558 |
559 | OAuthCustomResource:
560 | Type: 'AWS::Lambda::Function'
561 | Properties:
562 | Code:
563 | ZipFile: !Join
564 | - |+
565 | - - 'const response = require(''cfn-response'');'
566 | - 'const aws = require(''aws-sdk'');'
567 | - 'const identity = new aws.CognitoIdentityServiceProvider();'
568 | - 'exports.handler = (event, context, callback) => {'
569 | - 'try{'
570 | - ' const userPoolId = event.ResourceProperties.userPoolId;'
571 | - ' let webClientId = event.ResourceProperties.webClientId;'
572 | - ' let nativeClientId = event.ResourceProperties.nativeClientId;'
573 | - ' let hostedUIProviderMeta = JSON.parse(event.ResourceProperties.hostedUIProviderMeta);'
574 | - ' let oAuthMetadata = JSON.parse(event.ResourceProperties.oAuthMetadata);'
575 | - ' let providerList = hostedUIProviderMeta.map(provider => provider.ProviderName);'
576 | - ' providerList.push(''COGNITO'');'
577 | - ' if (event.RequestType == ''Delete'') {'
578 | - ' response.send(event, context, response.SUCCESS, {});'
579 | - ' }'
580 | - ' if (event.RequestType == ''Update'' || event.RequestType == ''Create'') {'
581 | - ' let params = {'
582 | - ' UserPoolId: userPoolId,'
583 | - ' AllowedOAuthFlows: oAuthMetadata.AllowedOAuthFlows,'
584 | - ' AllowedOAuthFlowsUserPoolClient: true,'
585 | - ' AllowedOAuthScopes: oAuthMetadata.AllowedOAuthScopes,'
586 | - ' CallbackURLs: oAuthMetadata.CallbackURLs,'
587 | - ' LogoutURLs: oAuthMetadata.LogoutURLs,'
588 | - ' SupportedIdentityProviders: providerList'
589 | - ' };'
590 | - ' let updateUserPoolClientPromises = [];'
591 | - ' params.ClientId = webClientId;'
592 | - ' updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());'
593 | - ' params.ClientId = nativeClientId;'
594 | - ' updateUserPoolClientPromises.push(identity.updateUserPoolClient(params).promise());'
595 | - ' Promise.all(updateUserPoolClientPromises)'
596 | - ' .then(() => {response.send(event, context, response.SUCCESS, {})}).catch((err) => {'
597 | - ' console.log(err.stack); response.send(event, context, response.FAILED, {err});'
598 | - ' });'
599 | - ' }'
600 | - '} catch(err) { console.log(err.stack); response.send(event, context, response.FAILED, {err});};'
601 | - '}'
602 |
603 | Handler: index.handler
604 | Runtime: nodejs8.10
605 | Timeout: '300'
606 | Role: !GetAtt
607 | - UserPoolClientRole
608 | - Arn
609 | DependsOn: HostedUIProvidersCustomResourceInputs
610 |
611 | OAuthCustomResourcePolicy:
612 | Type: 'AWS::IAM::Policy'
613 | Properties:
614 | PolicyName: !Join ['-',[!Ref UserPool, 'OAuth']]
615 | Roles:
616 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
617 | PolicyDocument:
618 | Version: '2012-10-17'
619 | Statement:
620 | - Effect: Allow
621 | Action:
622 | - 'cognito-idp:UpdateUserPoolClient'
623 | Resource: !GetAtt UserPool.Arn
624 | DependsOn: OAuthCustomResource
625 |
626 | OAuthCustomResourceLogPolicy:
627 | Type: 'AWS::IAM::Policy'
628 | Properties:
629 | PolicyName: !Join ['-',[!Ref UserPool, 'OAuthLogPolicy']]
630 | Roles:
631 | - !If [ShouldNotCreateEnvResources, !Ref userpoolClientLambdaRole, !Join ['',[!Ref userpoolClientLambdaRole, '-', !Ref env]]]
632 | PolicyDocument:
633 | Version: 2012-10-17
634 | Statement:
635 | - Effect: Allow
636 | Action:
637 | - 'logs:CreateLogGroup'
638 | - 'logs:CreateLogStream'
639 | - 'logs:PutLogEvents'
640 | Resource: !Sub
641 | - arn:aws:logs:${region}:${account}:log-group:/aws/lambda/${lambda}:log-stream:*
642 | - { region: !Ref "AWS::Region", account: !Ref "AWS::AccountId", lambda: !Ref OAuthCustomResource}
643 | DependsOn: OAuthCustomResourcePolicy
644 |
645 | OAuthCustomResourceInputs:
646 | Type: 'Custom::LambdaCallout'
647 | Properties:
648 | ServiceToken: !GetAtt OAuthCustomResource.Arn
649 | userPoolId: !Ref UserPool
650 | hostedUIProviderMeta: !Ref hostedUIProviderMeta
651 | oAuthMetadata: !Ref oAuthMetadata
652 | webClientId: !Ref 'UserPoolClientWeb'
653 | nativeClientId: !Ref 'UserPoolClient'
654 | DependsOn: OAuthCustomResourceLogPolicy
655 |
656 |
657 |
658 |
659 | # BEGIN IDENTITY POOL RESOURCES
660 |
661 |
662 | IdentityPool:
663 | # Always created
664 | Type: AWS::Cognito::IdentityPool
665 | Properties:
666 | IdentityPoolName: !If [ShouldNotCreateEnvResources, 'amplifyprojectb3fea6ea_identitypool_b3fea6ea', !Join ['',['amplifyprojectb3fea6ea_identitypool_b3fea6ea', '__', !Ref env]]]
667 |
668 | CognitoIdentityProviders:
669 | - ClientId: !Ref UserPoolClient
670 | ProviderName: !Sub
671 | - cognito-idp.${region}.amazonaws.com/${client}
672 | - { region: !Ref "AWS::Region", client: !Ref UserPool}
673 | - ClientId: !Ref UserPoolClientWeb
674 | ProviderName: !Sub
675 | - cognito-idp.${region}.amazonaws.com/${client}
676 | - { region: !Ref "AWS::Region", client: !Ref UserPool}
677 |
678 | AllowUnauthenticatedIdentities: !Ref allowUnauthenticatedIdentities
679 |
680 |
681 | DependsOn: UserPoolClientInputs
682 |
683 |
684 | IdentityPoolRoleMap:
685 | # Created to map Auth and Unauth roles to the identity pool
686 | # Depends on Identity Pool for ID ref
687 | Type: AWS::Cognito::IdentityPoolRoleAttachment
688 | Properties:
689 | IdentityPoolId: !Ref IdentityPool
690 | Roles:
691 | unauthenticated: !Ref unauthRoleArn
692 | authenticated: !Ref authRoleArn
693 | DependsOn: IdentityPool
694 |
695 |
696 | Outputs :
697 |
698 | IdentityPoolId:
699 | Value: !Ref 'IdentityPool'
700 | Description: Id for the identity pool
701 | IdentityPoolName:
702 | Value: !GetAtt IdentityPool.Name
703 |
704 |
705 | HostedUIDomain:
706 | Value: !If [ShouldNotCreateEnvResources, !Ref hostedUIDomainName, !Join ['-',[!Ref hostedUIDomainName, !Ref env]]]
707 |
708 |
709 | OAuthMetadata:
710 | Value: !Ref oAuthMetadata
711 |
712 |
713 | UserPoolId:
714 | Value: !Ref 'UserPool'
715 | Description: Id for the user pool
716 | UserPoolName:
717 | Value: !Ref userPoolName
718 | AppClientIDWeb:
719 | Value: !Ref 'UserPoolClientWeb'
720 | Description: The user pool app client id for web
721 | AppClientID:
722 | Value: !Ref 'UserPoolClient'
723 | Description: The user pool app client id
724 | AppClientSecret:
725 | Value: !GetAtt UserPoolClientInputs.appSecret
726 |
727 |
728 |
729 |
730 |
731 |
732 |
--------------------------------------------------------------------------------
/amplify/backend/auth/amplifyprojectb3fea6ea/parameters.json:
--------------------------------------------------------------------------------
1 | {
2 | "identityPoolName": "amplifyprojectb3fea6ea_identitypool_b3fea6ea",
3 | "allowUnauthenticatedIdentities": false,
4 | "resourceNameTruncated": "amplifb3fea6ea",
5 | "userPoolName": "amplifyprojectb3fea6ea_userpool_b3fea6ea",
6 | "autoVerifiedAttributes": [
7 | "email"
8 | ],
9 | "mfaConfiguration": "OFF",
10 | "mfaTypes": [
11 | "SMS Text Message"
12 | ],
13 | "smsAuthenticationMessage": "Your authentication code is {####}",
14 | "smsVerificationMessage": "Your verification code is {####}",
15 | "emailVerificationSubject": "Your verification code",
16 | "emailVerificationMessage": "Your verification code is {####}",
17 | "defaultPasswordPolicy": false,
18 | "passwordPolicyMinLength": 8,
19 | "passwordPolicyCharacters": [],
20 | "requiredAttributes": [
21 | "email"
22 | ],
23 | "userpoolClientGenerateSecret": true,
24 | "userpoolClientRefreshTokenValidity": 30,
25 | "userpoolClientWriteAttributes": [
26 | "email"
27 | ],
28 | "userpoolClientReadAttributes": [
29 | "email"
30 | ],
31 | "userpoolClientLambdaRole": "amplifb3fea6ea_userpoolclient_lambda_role",
32 | "userpoolClientSetAttributes": false,
33 | "resourceName": "amplifyprojectb3fea6ea",
34 | "authSelections": "identityPoolAndUserPool",
35 | "authRoleArn": {
36 | "Fn::GetAtt": [
37 | "AuthRole",
38 | "Arn"
39 | ]
40 | },
41 | "unauthRoleArn": {
42 | "Fn::GetAtt": [
43 | "UnauthRole",
44 | "Arn"
45 | ]
46 | },
47 | "useDefault": "defaultSocial",
48 | "hostedUI": true,
49 | "hostedUIDomainName": "amplifyprojectb3fea6ea-b3fea6ea",
50 | "authProvidersUserPool": [
51 | "Facebook",
52 | "Google",
53 | "LoginWithAmazon"
54 | ],
55 | "hostedUIProviderMeta": "[{\"ProviderName\":\"Facebook\",\"authorize_scopes\":\"email,public_profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"id\"}},{\"ProviderName\":\"Google\",\"authorize_scopes\":\"openid email profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"sub\"}},{\"ProviderName\":\"LoginWithAmazon\",\"authorize_scopes\":\"profile profile:user_id\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"user_id\"}}]",
56 | "oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"https://192.168.0.80:19006/\"],\"LogoutURLs\":[\"https://192.168.0.80:19006/\"]}",
57 | "dependsOn": []
58 | }
--------------------------------------------------------------------------------
/amplify/backend/awscloudformation/nested-cloudformation-stack.yml:
--------------------------------------------------------------------------------
1 | {
2 | "AWSTemplateFormatVersion": "2010-09-09",
3 | "Description": "Root stack for the Amplify AWS CloudFormation provider",
4 | "Parameters": {
5 | "DeploymentBucketName": {
6 | "Description": "Name of the common deployment bucket provided by the parent stack",
7 | "Type": "String",
8 | "Default": "DeploymentBucket"
9 | },
10 | "AuthRoleName": {
11 | "Type": "String",
12 | "Default": "AuthRoleName"
13 | },
14 | "UnauthRoleName": {
15 | "Type": "String",
16 | "Default": "UnauthRoleName"
17 | }
18 | },
19 | "Resources": {
20 | "DeploymentBucket": {
21 | "Type": "AWS::S3::Bucket",
22 | "DeletionPolicy": "Retain",
23 | "Properties": {
24 | "BucketName": {
25 | "Ref": "DeploymentBucketName"
26 | }
27 | }
28 | },
29 | "AuthRole": {
30 | "Type": "AWS::IAM::Role",
31 | "Properties": {
32 | "RoleName": {
33 | "Ref": "AuthRoleName"
34 | },
35 | "AssumeRolePolicyDocument": {
36 | "Version": "2012-10-17",
37 | "Statement": [
38 | {
39 | "Sid": "",
40 | "Effect": "Deny",
41 | "Principal": {
42 | "Federated": "cognito-identity.amazonaws.com"
43 | },
44 | "Action": "sts:AssumeRoleWithWebIdentity"
45 | }
46 | ]
47 | }
48 | }
49 | },
50 | "UnauthRole": {
51 | "Type": "AWS::IAM::Role",
52 | "Properties": {
53 | "RoleName": {
54 | "Ref": "UnauthRoleName"
55 | },
56 | "AssumeRolePolicyDocument": {
57 | "Version": "2012-10-17",
58 | "Statement": [
59 | {
60 | "Sid": "",
61 | "Effect": "Deny",
62 | "Principal": {
63 | "Federated": "cognito-identity.amazonaws.com"
64 | },
65 | "Action": "sts:AssumeRoleWithWebIdentity"
66 | }
67 | ]
68 | }
69 | }
70 | },
71 | "apitodoApi": {
72 | "Type": "AWS::CloudFormation::Stack",
73 | "Properties": {
74 | "TemplateURL": "https://s3.amazonaws.com/amplifyproject-test-20190919143906-deployment/amplify-cfn-templates/api/cloudformation-template.json",
75 | "Parameters": {
76 | "CreateAPIKey": 1,
77 | "AppSyncApiName": "todoApi",
78 | "DynamoDBBillingMode": "PAY_PER_REQUEST",
79 | "DynamoDBEnableServerSideEncryption": "false",
80 | "S3DeploymentBucket": "amplifyproject-test-20190919143906-deployment",
81 | "S3DeploymentRootKey": "amplify-appsync-files/4b4b159fa3fedb4ab8ed48d581bcb35cf038c826",
82 | "env": "test"
83 | }
84 | }
85 | },
86 | "authamplifyprojectb3fea6ea": {
87 | "Type": "AWS::CloudFormation::Stack",
88 | "Properties": {
89 | "TemplateURL": "https://s3.amazonaws.com/amplifyproject-test-20190919143906-deployment/amplify-cfn-templates/auth/amplifyprojectb3fea6ea-cloudformation-template.yml",
90 | "Parameters": {
91 | "identityPoolName": "amplifyprojectb3fea6ea_identitypool_b3fea6ea",
92 | "allowUnauthenticatedIdentities": false,
93 | "resourceNameTruncated": "amplifb3fea6ea",
94 | "userPoolName": "amplifyprojectb3fea6ea_userpool_b3fea6ea",
95 | "autoVerifiedAttributes": "email",
96 | "mfaConfiguration": "OFF",
97 | "mfaTypes": "SMS Text Message",
98 | "smsAuthenticationMessage": "Your authentication code is {####}",
99 | "smsVerificationMessage": "Your verification code is {####}",
100 | "emailVerificationSubject": "Your verification code",
101 | "emailVerificationMessage": "Your verification code is {####}",
102 | "defaultPasswordPolicy": false,
103 | "passwordPolicyMinLength": 8,
104 | "passwordPolicyCharacters": "",
105 | "requiredAttributes": "email",
106 | "userpoolClientGenerateSecret": true,
107 | "userpoolClientRefreshTokenValidity": 30,
108 | "userpoolClientWriteAttributes": "email",
109 | "userpoolClientReadAttributes": "email",
110 | "userpoolClientLambdaRole": "amplifb3fea6ea_userpoolclient_lambda_role",
111 | "userpoolClientSetAttributes": false,
112 | "resourceName": "amplifyprojectb3fea6ea",
113 | "authSelections": "identityPoolAndUserPool",
114 | "authRoleArn": {
115 | "Fn::GetAtt": [
116 | "AuthRole",
117 | "Arn"
118 | ]
119 | },
120 | "unauthRoleArn": {
121 | "Fn::GetAtt": [
122 | "UnauthRole",
123 | "Arn"
124 | ]
125 | },
126 | "useDefault": "defaultSocial",
127 | "hostedUI": true,
128 | "hostedUIDomainName": "amplifyprojectb3fea6ea-b3fea6ea",
129 | "authProvidersUserPool": "Facebook,Google,LoginWithAmazon",
130 | "hostedUIProviderMeta": "[{\"ProviderName\":\"Facebook\",\"authorize_scopes\":\"email,public_profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"id\"}},{\"ProviderName\":\"Google\",\"authorize_scopes\":\"openid email profile\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"sub\"}},{\"ProviderName\":\"LoginWithAmazon\",\"authorize_scopes\":\"profile profile:user_id\",\"AttributeMapping\":{\"email\":\"email\",\"username\":\"user_id\"}}]",
131 | "oAuthMetadata": "{\"AllowedOAuthFlows\":[\"code\"],\"AllowedOAuthScopes\":[\"phone\",\"email\",\"openid\",\"profile\",\"aws.cognito.signin.user.admin\"],\"CallbackURLs\":[\"https://192.168.0.80:19006/\"],\"LogoutURLs\":[\"https://192.168.0.80:19006/\"]}",
132 | "dependsOn": "",
133 | "hostedUIProviderCreds": "[{\"ProviderName\":\"Facebook\",\"client_id\":\"394347568157898\",\"client_secret\":\"dc2cd59e4b92c604344015e0035dc062\"},{\"ProviderName\":\"Google\",\"client_id\":\"86848591885-pcvo4gsh7dfq09o7igoeacrhqdko5o2g.apps.googleusercontent.com\",\"client_secret\":\"lkuzCgvOYtsheVaP8P8BI9_t\"},{\"ProviderName\":\"LoginWithAmazon\",\"client_id\":\"amzn1.application-oa2-client.30d31882e1794c68b4984697305c0e43\",\"client_secret\":\"d8b9e79ca1eb83d40b2a0e85db3280c7b49a8252a322373e4dfb09b0c4c3557e\"}]",
134 | "env": "test"
135 | }
136 | }
137 | },
138 | "UpdateRolesWithIDPFunction": {
139 | "DependsOn": [
140 | "AuthRole",
141 | "UnauthRole",
142 | "authamplifyprojectb3fea6ea"
143 | ],
144 | "Type": "AWS::Lambda::Function",
145 | "Properties": {
146 | "Code": {
147 | "ZipFile": {
148 | "Fn::Join": [
149 | "\n",
150 | [
151 | "const response = require('cfn-response');",
152 | "const aws = require('aws-sdk');",
153 | "let responseData = {};",
154 | "exports.handler = function(event, context) {",
155 | " try {",
156 | " let authRoleName = event.ResourceProperties.authRoleName;",
157 | " let unauthRoleName = event.ResourceProperties.unauthRoleName;",
158 | " let idpId = event.ResourceProperties.idpId;",
159 | " let promises = [];",
160 | " let authParamsJson = { 'Version': '2012-10-17','Statement': [{'Effect': 'Allow','Principal': {'Federated': 'cognito-identity.amazonaws.com'},'Action': 'sts:AssumeRoleWithWebIdentity','Condition': {'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'authenticated'}}}]};",
161 | " let unauthParamsJson = { 'Version': '2012-10-17','Statement': [{'Effect': 'Allow','Principal': {'Federated': 'cognito-identity.amazonaws.com'},'Action': 'sts:AssumeRoleWithWebIdentity','Condition': {'StringEquals': {'cognito-identity.amazonaws.com:aud': idpId},'ForAnyValue:StringLike': {'cognito-identity.amazonaws.com:amr': 'unauthenticated'}}}]};",
162 | " if (event.RequestType == 'Delete') {",
163 | " delete authParamsJson.Statement.Condition;",
164 | " delete unauthParamsJson.Statement.Condition;",
165 | " let authParams = { PolicyDocument: JSON.stringify(authParamsJson),RoleName: authRoleName};",
166 | " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson),RoleName: unauthRoleName};",
167 | " const iam = new aws.IAM({ apiVersion: '2010-05-08', region: event.ResourceProperties.region});",
168 | " promises.push(iam.updateAssumeRolePolicy(authParams).promise());",
169 | " promises.push(iam.updateAssumeRolePolicy(unauthParams).promise());",
170 | " Promise.all(promises)",
171 | " .then((res) => {",
172 | " console.log(\"delete\" + res);",
173 | " console.log(\"response data\" + JSON.stringify(res));",
174 | " response.send(event, context, response.SUCCESS, res);",
175 | " });",
176 | " }",
177 | " if (event.RequestType == 'Update' || event.RequestType == 'Create') {",
178 | " const iam = new aws.IAM({ apiVersion: '2010-05-08', region: event.ResourceProperties.region});",
179 | " let authParams = { PolicyDocument: JSON.stringify(authParamsJson),RoleName: authRoleName};",
180 | " let unauthParams = {PolicyDocument: JSON.stringify(unauthParamsJson),RoleName: unauthRoleName};",
181 | " promises.push(iam.updateAssumeRolePolicy(authParams).promise());",
182 | " promises.push(iam.updateAssumeRolePolicy(unauthParams).promise());",
183 | " Promise.all(promises)",
184 | " .then((res) => {",
185 | " console.log(\"createORupdate\" + res);",
186 | " console.log(\"response data\" + JSON.stringify(res));",
187 | " response.send(event, context, response.SUCCESS, {});",
188 | " });",
189 | " }",
190 | " } catch(err) {",
191 | " console.log(err.stack);",
192 | " responseData = {Error: err};",
193 | " response.send(event, context, response.FAILED, responseData);",
194 | " throw err;",
195 | " }",
196 | "};"
197 | ]
198 | ]
199 | }
200 | },
201 | "Handler": "index.handler",
202 | "Runtime": "nodejs8.10",
203 | "Timeout": "300",
204 | "Role": {
205 | "Fn::GetAtt": [
206 | "UpdateRolesWithIDPFunctionRole",
207 | "Arn"
208 | ]
209 | }
210 | }
211 | },
212 | "UpdateRolesWithIDPFunctionOutputs": {
213 | "Type": "Custom::LambdaCallout",
214 | "Properties": {
215 | "ServiceToken": {
216 | "Fn::GetAtt": [
217 | "UpdateRolesWithIDPFunction",
218 | "Arn"
219 | ]
220 | },
221 | "region": {
222 | "Ref": "AWS::Region"
223 | },
224 | "idpId": {
225 | "Fn::GetAtt": [
226 | "authamplifyprojectb3fea6ea",
227 | "Outputs.IdentityPoolId"
228 | ]
229 | },
230 | "authRoleName": {
231 | "Ref": "AuthRoleName"
232 | },
233 | "unauthRoleName": {
234 | "Ref": "UnauthRoleName"
235 | }
236 | }
237 | },
238 | "UpdateRolesWithIDPFunctionRole": {
239 | "Type": "AWS::IAM::Role",
240 | "Properties": {
241 | "RoleName": {
242 | "Fn::Join": [
243 | "",
244 | [
245 | {
246 | "Ref": "AuthRoleName"
247 | },
248 | "-idp"
249 | ]
250 | ]
251 | },
252 | "AssumeRolePolicyDocument": {
253 | "Version": "2012-10-17",
254 | "Statement": [
255 | {
256 | "Effect": "Allow",
257 | "Principal": {
258 | "Service": [
259 | "lambda.amazonaws.com"
260 | ]
261 | },
262 | "Action": [
263 | "sts:AssumeRole"
264 | ]
265 | }
266 | ]
267 | },
268 | "Policies": [
269 | {
270 | "PolicyName": "UpdateRolesWithIDPFunctionPolicy",
271 | "PolicyDocument": {
272 | "Version": "2012-10-17",
273 | "Statement": [
274 | {
275 | "Effect": "Allow",
276 | "Action": [
277 | "logs:CreateLogGroup",
278 | "logs:CreateLogStream",
279 | "logs:PutLogEvents"
280 | ],
281 | "Resource": "arn:aws:logs:*:*:*"
282 | },
283 | {
284 | "Effect": "Allow",
285 | "Action": "iam:UpdateAssumeRolePolicy",
286 | "Resource": {
287 | "Fn::GetAtt": [
288 | "AuthRole",
289 | "Arn"
290 | ]
291 | }
292 | },
293 | {
294 | "Effect": "Allow",
295 | "Action": "iam:UpdateAssumeRolePolicy",
296 | "Resource": {
297 | "Fn::GetAtt": [
298 | "UnauthRole",
299 | "Arn"
300 | ]
301 | }
302 | }
303 | ]
304 | }
305 | }
306 | ]
307 | }
308 | }
309 | },
310 | "Outputs": {
311 | "Region": {
312 | "Description": "CloudFormation provider root stack Region",
313 | "Value": {
314 | "Ref": "AWS::Region"
315 | },
316 | "Export": {
317 | "Name": {
318 | "Fn::Sub": "${AWS::StackName}-Region"
319 | }
320 | }
321 | },
322 | "StackName": {
323 | "Description": "CloudFormation provider root stack ID",
324 | "Value": {
325 | "Ref": "AWS::StackName"
326 | },
327 | "Export": {
328 | "Name": {
329 | "Fn::Sub": "${AWS::StackName}-StackName"
330 | }
331 | }
332 | },
333 | "StackId": {
334 | "Description": "CloudFormation provider root stack name",
335 | "Value": {
336 | "Ref": "AWS::StackId"
337 | },
338 | "Export": {
339 | "Name": {
340 | "Fn::Sub": "${AWS::StackName}-StackId"
341 | }
342 | }
343 | },
344 | "DeploymentBucketName": {
345 | "Description": "CloudFormation provider root stack deployment bucket name",
346 | "Value": {
347 | "Ref": "DeploymentBucketName"
348 | },
349 | "Export": {
350 | "Name": {
351 | "Fn::Sub": "${AWS::StackName}-DeploymentBucketName"
352 | }
353 | }
354 | },
355 | "AuthRoleArn": {
356 | "Value": {
357 | "Fn::GetAtt": [
358 | "AuthRole",
359 | "Arn"
360 | ]
361 | }
362 | },
363 | "UnauthRoleArn": {
364 | "Value": {
365 | "Fn::GetAtt": [
366 | "UnauthRole",
367 | "Arn"
368 | ]
369 | }
370 | },
371 | "AuthRoleName": {
372 | "Value": {
373 | "Ref": "AuthRole"
374 | }
375 | },
376 | "UnauthRoleName": {
377 | "Value": {
378 | "Ref": "UnauthRole"
379 | }
380 | }
381 | }
382 | }
--------------------------------------------------------------------------------
/amplify/backend/backend-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "api": {
3 | "todoApi": {
4 | "service": "AppSync",
5 | "providerPlugin": "awscloudformation",
6 | "output": {
7 | "authConfig": {
8 | "additionalAuthenticationProviders": [],
9 | "defaultAuthentication": {
10 | "authenticationType": "API_KEY",
11 | "apiKeyConfig": {
12 | "description": "API key desc",
13 | "apiKeyExpirationDays": 180
14 | }
15 | }
16 | }
17 | }
18 | }
19 | },
20 | "auth": {
21 | "amplifyprojectb3fea6ea": {
22 | "service": "Cognito",
23 | "providerPlugin": "awscloudformation",
24 | "dependsOn": []
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/amplify/team-provider-info.json:
--------------------------------------------------------------------------------
1 | {
2 | "test": {
3 | "awscloudformation": {
4 | "AuthRoleName": "amplifyproject-test-20190919143906-authRole",
5 | "UnauthRoleArn": "arn:aws:iam::082042224423:role/amplifyproject-test-20190919143906-unauthRole",
6 | "AuthRoleArn": "arn:aws:iam::082042224423:role/amplifyproject-test-20190919143906-authRole",
7 | "Region": "us-east-1",
8 | "DeploymentBucketName": "amplifyproject-test-20190919143906-deployment",
9 | "UnauthRoleName": "amplifyproject-test-20190919143906-unauthRole",
10 | "StackName": "amplifyproject-test-20190919143906",
11 | "StackId": "arn:aws:cloudformation:us-east-1:082042224423:stack/amplifyproject-test-20190919143906/17196b80-dad2-11e9-a39a-0e8cd4caae34"
12 | },
13 | "categories": {
14 | "auth": {
15 | "amplifyprojectb3fea6ea": {
16 | "hostedUIProviderCreds": "[{\"ProviderName\":\"Facebook\",\"client_id\":\"394347568157898\",\"client_secret\":\"dc2cd59e4b92c604344015e0035dc062\"},{\"ProviderName\":\"Google\",\"client_id\":\"86848591885-pcvo4gsh7dfq09o7igoeacrhqdko5o2g.apps.googleusercontent.com\",\"client_secret\":\"lkuzCgvOYtsheVaP8P8BI9_t\"},{\"ProviderName\":\"LoginWithAmazon\",\"client_id\":\"amzn1.application-oa2-client.30d31882e1794c68b4984697305c0e43\",\"client_secret\":\"d8b9e79ca1eb83d40b2a0e85db3280c7b49a8252a322373e4dfb09b0c4c3557e\"}]"
17 | }
18 | }
19 | }
20 | }
21 | }
--------------------------------------------------------------------------------
/aws-exports.js:
--------------------------------------------------------------------------------
1 | // WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.
2 |
3 | const awsmobile = {
4 | "aws_project_region": "us-east-1",
5 | "aws_appsync_graphqlEndpoint": "https://6oqacvdcd5ehbkhflibujnjzpy.appsync-api.us-east-1.amazonaws.com/graphql",
6 | "aws_appsync_region": "us-east-1",
7 | "aws_appsync_authenticationType": "API_KEY",
8 | "aws_appsync_apiKey": "da2-iawhwbfha5c3dhf3efuwpxphxy",
9 | "aws_cognito_identity_pool_id": "us-east-1:4b34cfd5-e707-4432-9a9c-49a6b2eb4723",
10 | "aws_cognito_region": "us-east-1",
11 | "aws_user_pools_id": "us-east-1_JEGRSXJ1m",
12 | "aws_user_pools_web_client_id": "1siqsh7nie77r156gmpve4bdh5",
13 | "oauth": {
14 | "domain": "amplifyprojectb3fea6ea-b3fea6ea-test.auth.us-east-1.amazoncognito.com",
15 | "scope": [
16 | "phone",
17 | "email",
18 | "openid",
19 | "profile",
20 | "aws.cognito.signin.user.admin"
21 | ],
22 | "redirectSignIn": "https://192.168.0.80:19006/",
23 | "redirectSignOut": "https://192.168.0.80:19006/",
24 | "responseType": "code"
25 | },
26 | "federationTarget": "COGNITO_USER_POOLS"
27 | };
28 |
29 |
30 | export default awsmobile;
31 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "main": "node_modules/expo/AppEntry.js",
3 | "scripts": {
4 | "start": "expo start",
5 | "android": "expo start --android",
6 | "ios": "expo start --ios",
7 | "web": "expo start --web",
8 | "eject": "expo eject"
9 | },
10 | "dependencies": {
11 | "@aws-amplify/api": "^1.1.3",
12 | "@aws-amplify/pubsub": "^1.1.2",
13 | "aws-amplify": "^1.1.40",
14 | "aws-amplify-react-native": "^2.1.19",
15 | "expo": "^34.0.1",
16 | "formik": "^1.5.8",
17 | "react": "16.8.3",
18 | "react-dom": "^16.8.6",
19 | "react-native": "https://github.com/expo/react-native/archive/sdk-34.0.0.tar.gz",
20 | "react-native-gesture-handler": "^1.4.1",
21 | "react-native-reanimated": "^1.3.0",
22 | "react-native-screens": "^2.0.0-alpha.3",
23 | "react-native-web": "^0.11.4",
24 | "react-navigation-stack": "^1.9.3",
25 | "react-redux": "^7.1.1",
26 | "redux": "^4.0.4",
27 | "redux-devtools-extension": "^2.13.8",
28 | "redux-thunk": "^2.3.0",
29 | "yup": "^0.27.0"
30 | },
31 | "devDependencies": {
32 | "babel-preset-expo": "^6.0.0",
33 | "react-navigation": "^4.0.10"
34 | },
35 | "private": true
36 | }
37 |
--------------------------------------------------------------------------------
/src/components/Bottom.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {View, Button, StyleSheet} from 'react-native';
3 | import {connect} from 'react-redux';
4 | import {setFilter} from "./actions";
5 |
6 | const Bottom = ({setFilter}) => {
7 | return (
8 |
9 |
10 |
23 |
24 | );
25 | };
26 |
27 | const styles = StyleSheet.create({
28 | container: {
29 | flexDirection: 'row',
30 | justifyContent: 'space-evenly',
31 | // borderColor: 'red',
32 | // borderWidth: 2,
33 | },
34 | button: {
35 | width: '30%'
36 | }
37 | });
38 |
39 | const mapDispatchToProps = dispatch => ({
40 | setFilter: (filter) => dispatch(setFilter(filter)),
41 | });
42 |
43 | export default connect(null, mapDispatchToProps)(Bottom);
--------------------------------------------------------------------------------
/src/components/Dialog.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import { View, Alert, StyleSheet, Button} from 'react-native';
3 | import {connect} from "react-redux";
4 | import {setDialog} from "./actions";
5 |
6 | const Dialog = ({ title, message, setDialog }) => {
7 | return (
8 |
9 | {Alert.alert(
10 | title,
11 | message,
12 | [
13 | {
14 | text: 'Cancel',
15 | onPress: () => {setDialog(false, '', '')},
16 | style: 'cancel',
17 | },
18 | { text: 'OK', onPress: () => {setDialog(false, '', '')} },
19 | ],
20 | { cancelable: false }
21 | )}
22 |
23 |
24 | );
25 | };
26 |
27 | const mapStateToProps = state => ({
28 | title: state.dialog.title,
29 | message: state.dialog.message,
30 | });
31 |
32 | const mapDispatchToProps = dispatch => {
33 | return {
34 | setDialog: (value, title, message) => dispatch(setDialog(value, title, message)),
35 | }
36 | }
37 |
38 |
39 | export default connect(null, mapDispatchToProps)(Dialog);
--------------------------------------------------------------------------------
/src/components/Header.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {View, TextInput, Button, StyleSheet} from 'react-native';
3 | import {createTodo} from "../graphql/mutations";
4 | import {listTodos} from "../graphql/queries";
5 | import {connect} from 'react-redux';
6 | import {fetchQuery, onCreateTodoSubscription, setDialog} from "./actions";
7 | import Dialog from "./Dialog";
8 | import {graphQLOperation} from './helpers';
9 | import {onCreateTodo} from "../graphql/subscriptions";
10 |
11 | class Header extends Component {
12 | constructor(props) {
13 | super(props);
14 | this.state = {
15 | inputValue: '',
16 | showDialog: false,
17 | subscription: null
18 | }
19 | }
20 |
21 | componentDidMount() {
22 | const subscription = this.props.onCreateTodoSubscription(onCreateTodo);
23 | this.setState({subscription});
24 | };
25 |
26 | componentWillUnmount() {
27 | this.state.subscription.unsubscribe();
28 | };
29 |
30 | createTodo = todo => {
31 | console.log(todo);
32 | console.log('create todo Header 32');
33 | return graphQLOperation(createTodo, {input: todo});
34 | };
35 |
36 | createNewTodo() {
37 | const {inputValue} = this.state;
38 | if (this.state.inputValue.length > 0) {
39 | const todo = { name: inputValue, description: "Realtime and Offline", completed: false, time: '06.05.1996'};
40 | this.createTodo(todo)
41 | .then(response => {
42 | if (response.data.createTodo.name === inputValue) {
43 | this.setState({
44 | inputValue: '',
45 | dialogMessage: inputValue
46 | });
47 | }
48 | })
49 | .catch(error => {
50 | console.log('______________________________________');
51 | console.log('Header 55 catch error');
52 | console.log(error);
53 | });
54 | } else
55 | alert('Todo list name shouldn\'t be empty')
56 | };
57 |
58 | handleTextInput = (text) => {
59 | this.setState({inputValue: text});
60 | };
61 |
62 | render() {
63 | const {inputValue, dialogMessage} = this.state;
64 | return (
65 |
66 | {this.props.showDialog ? : null}
67 | this.handleTextInput(text)}
70 | value={inputValue}
71 | placeholder='Todo'
72 | />
73 |
77 |
78 | );
79 | }
80 | };
81 |
82 | const styles = StyleSheet.create({
83 | container: {
84 | marginTop: 30,
85 | flexDirection: 'row',
86 | justifyContent: 'space-between',
87 | marginLeft: 5,
88 | marginRight: 5
89 | },
90 | button: {
91 | width: '30%'
92 | },
93 | input: {
94 | width: '50%',
95 | borderWidth: 1,
96 | borderColor: 'grey',
97 | borderRadius: 5
98 | }
99 | });
100 |
101 | const mapStateToProps = state => ({
102 | showDialog: state.dialog.showDialog,
103 | });
104 |
105 | const mapDispatchToProps = (dispatch) => ({
106 | getTodos: (data) => dispatch(fetchQuery(data)),
107 | onCreateTodoSubscription: subscription => dispatch(onCreateTodoSubscription(subscription)),
108 | setDialog: (value, title, message) => dispatch(setDialog(value, title, message)),
109 | });
110 |
111 | export default connect(mapStateToProps, mapDispatchToProps)(Header);
--------------------------------------------------------------------------------
/src/components/OAuthButton.js:
--------------------------------------------------------------------------------
1 | import { withOAuth } from 'aws-amplify-react-native';
2 | import React, { Component } from 'react';
3 |
4 | class OAuthButton extends Component {
5 | render() {
6 | return (
7 |
8 | Sign in with AWS
9 |
10 | )
11 | }
12 | }
13 |
14 | export default withOAuth(OAuthButton);
--------------------------------------------------------------------------------
/src/components/Todos.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {View, SafeAreaView, FlatList, StyleSheet, Text, TouchableHighlight, TouchableOpacity} from 'react-native';
3 | import ActivityIndicator from "./ActivityIndicator";
4 | import {connect} from 'react-redux';
5 | import {listTodos} from "../graphql/queries";
6 | import {fetchQuery, onUpdateTodoSubscription} from "./actions";
7 | import {updateTodo} from "../graphql/mutations";
8 | import {onUpdateTodo} from "../graphql/subscriptions";
9 | import {graphQLOperation} from './helpers';
10 |
11 | class Todos extends Component {
12 | state = {
13 | updateTodoSubscription: null
14 | };
15 |
16 | getData() {
17 | this.props.getTodos(listTodos);
18 | };
19 |
20 | componentDidMount() {
21 | const updateTodoSubscription = this.props.onUpdateTodoSubscription(onUpdateTodo) ;
22 | this.setState({updateTodoSubscription});
23 | this.getData();
24 | };
25 |
26 | componentWillUnmount() {
27 | this.state.updateTodoSubscription.unsubscribe();
28 | };
29 |
30 | handleTodoPress = todo => {
31 | graphQLOperation(updateTodo, {input: {...todo, time: '05.06.1995', completed: !todo.completed}})
32 | .catch(error => {
33 | console.log(error);
34 | console.log('Todos 24');
35 | });
36 | };
37 |
38 | filterTodos = () => {
39 | const {todos, filter} = this.props;
40 | switch (filter) {
41 | case 'all': return todos;
42 | case 'active': return todos.filter(todo => !todo.completed);
43 | case 'completed': return todos.filter(todo => todo.completed);
44 | default: return todos;
45 | }
46 | };
47 |
48 | render() {
49 | const {loading} = this.props;
50 |
51 | const listData = this.filterTodos().map(todo => ({
52 | id: todo.id,
53 | name: todo.name,
54 | description: todo.description,
55 | time: todo.time,
56 | active: todo.active,
57 | all: todo.all,
58 | completed: todo.completed
59 | }));
60 |
61 | if(loading)
62 | return ;
63 |
64 | return (
65 | true)}
68 | >
69 |
70 | item.id}
72 | data={listData}
73 | renderItem={({item, index, separators}) => (
74 | {this.handleTodoPress(item)}}
76 | // onShowUnderlay={separators.highlight}
77 | // onHideUnderlay={separators.unhighlight}
78 | >
79 |
80 |
83 | {item.name}
84 |
85 |
86 | )}
87 | />
88 |
89 |
90 |
91 |
92 | );
93 | }
94 |
95 | };
96 |
97 | const styles = StyleSheet.create({
98 | container: {
99 | flex: 1,
100 | width: '100%',
101 | alignItems: 'flex-start',
102 | marginLeft: 5,
103 | // borderColor: 'black',
104 | // borderWidth: 2
105 | // height: 100
106 | },
107 | text: {
108 | fontSize: 22,
109 | },
110 | completedTodo: {
111 | textDecorationLine: 'line-through'
112 | }
113 | })
114 |
115 | const mapStateToProps = state => ({
116 | todos: state.queryReducer.todos,
117 | loading: state.queryReducer.loading,
118 | filter: state.filterReducer.filter
119 | });
120 |
121 | const mapDispatchToProps = (dispatch) => ({
122 | getTodos: (data) => dispatch(fetchQuery(data)),
123 | onUpdateTodoSubscription: newTodo => dispatch(onUpdateTodoSubscription(newTodo)),
124 | }) ;
125 |
126 | export default connect(mapStateToProps, mapDispatchToProps)(Todos);
--------------------------------------------------------------------------------
/src/components/actions.js:
--------------------------------------------------------------------------------
1 | import {graphQLOperation} from './helpers';
2 |
3 | export const QUERY = "QUERY";
4 | export const SUBSCRIPTION_ON_CREATE_TODO = "SUBSCRIPTION_ON_CREATE_TODO";
5 | export const SUBSCRIPTION_ON_UPDATE_TODO = 'SUBSCRIPTION_ON_UPDATE_TODO';
6 | export const FETCH_QUERY_BEGINNING = 'FETCH_QUERY_BEGINNING';
7 | export const FETCH_QUERY_SUCCESS = 'FETCH_QUERY_SUCCESS';
8 | export const FETCH_QUERY_FAIL = 'FETCH_QUERY_FAIL';
9 | export const SET_FILTER = 'SET_FILTER';
10 | export const ADD_TODOS = 'ADD_TODOS';
11 | export const SET_DIALOG = 'SET_DIALOG';
12 |
13 | const add_Todos = todos => ({
14 | type: ADD_TODOS,
15 | payload: {
16 | todos
17 | }
18 | });
19 |
20 | const fetchQueryBeginning = () => {
21 | return {
22 | type: FETCH_QUERY_BEGINNING
23 | }
24 | };
25 |
26 | const fetchQuerySuccess = data => {
27 | // console.log(data);
28 | return {
29 | type: FETCH_QUERY_SUCCESS,
30 | payload: {
31 | todos: data.data.listTodos.items
32 | }
33 | }
34 | };
35 |
36 | const fetchQueryFail = error => {
37 | return {
38 | type: FETCH_QUERY_FAIL,
39 | payload: {
40 | error: error
41 | }
42 | }
43 | };
44 |
45 | export const setFilter = filter => {
46 | return {
47 | type: SET_FILTER,
48 | payload: {
49 | filter
50 | }
51 | }
52 | };
53 |
54 | const getLists = async (listTodos, nextToken = null) => {
55 | return graphQLOperation(listTodos, nextToken);
56 | };
57 |
58 | export const fetchQuery = (listTodos) => {
59 | return async dispatch => {
60 | dispatch(fetchQueryBeginning());
61 |
62 | getLists(listTodos)
63 | .then(async result => {
64 | console.log('actions 73');
65 | console.log(result.data.listTodos.nextToken);
66 | dispatch(fetchQuerySuccess(result));
67 | // getLists(listTodos, {nextToken: result.data.listTodos.nextToken}).then(result => dispatch(fetchQuerySuccess(result)))
68 | // dispatch(fetchQuerySuccess(result));
69 | })
70 | .catch(error => {
71 | dispatch(fetchQueryFail(error))
72 | });
73 | }
74 | };
75 |
76 | const createTodoSubscription = (data) => ({
77 | type: SUBSCRIPTION_ON_CREATE_TODO,
78 | payload: {
79 | todo: data
80 | }
81 | });
82 |
83 | export const onCreateTodoSubscription = subscription => {
84 | return dispatch => {
85 | return graphQLOperation(subscription).subscribe({
86 | next: eventData => {
87 | const todo = eventData.value.data.onCreateTodo;
88 | dispatch(createTodoSubscription(todo));
89 | dispatch(setDialog(true, 'Todo was created', todo.name));
90 |
91 | console.log(todo);
92 | console.log('actions 91');
93 | }
94 | })
95 | }
96 | };
97 |
98 | const updateTodoSubscription = (data) => ({
99 | type: SUBSCRIPTION_ON_UPDATE_TODO,
100 | payload: {
101 | newTodo: data
102 | }
103 | });
104 |
105 | export const onUpdateTodoSubscription = (subscription) => {
106 | return dispatch => {
107 | return graphQLOperation(subscription).subscribe({
108 | next: eventData => {
109 | const todo = eventData.value.data.onUpdateTodo;
110 | dispatch(updateTodoSubscription(todo));
111 | console.log(todo);
112 | console.log('actions 112');
113 |
114 | }
115 | });
116 | }
117 | };
118 |
119 | export const setDialog = (value, title, message) => ({
120 | type: SET_DIALOG,
121 | payload: {
122 | showDialog: value,
123 | title,
124 | message
125 | }
126 | });
127 |
128 |
--------------------------------------------------------------------------------
/src/components/dialogReducer.js:
--------------------------------------------------------------------------------
1 | import {SET_DIALOG, QUERY } from './actions';
2 |
3 | const initialState = {
4 | showDialog: false,
5 | title: '',
6 | message: '',
7 | };
8 |
9 | const dialogReducer = (state=initialState, action) => {
10 | const {type, payload} = action;
11 | console.log(state);
12 | console.log('dialogreducer 18');
13 | switch(type) {
14 | case SET_DIALOG: return {...state, showDialog: true, title: payload.title, message: payload.message};
15 | default: return state;
16 | }
17 | };
18 |
19 | export default dialogReducer;
--------------------------------------------------------------------------------
/src/components/filterReducer.js:
--------------------------------------------------------------------------------
1 | import {SET_FILTER} from "./actions";
2 |
3 | const INITIAL_VALUE = {
4 | filter: ''
5 | };
6 |
7 | export const filterReducer = (state=INITIAL_VALUE, action) => {
8 | const {type, payload} = action;
9 | switch (type) {
10 | case SET_FILTER: return {...state, filter: payload.filter};
11 | default: return state;
12 | }
13 | };
--------------------------------------------------------------------------------
/src/components/forgotPassword/ForgotPassword.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {Formik} from 'formik';
3 | import {View, Text, TextInput, StyleSheet, Button} from "react-native";
4 | import * as Yup from "yup";
5 |
6 | class ForgotPassword extends Component {
7 | static navigationOptions = {
8 | title: 'forgot',
9 | // header: null ,
10 | };
11 |
12 | state = {
13 | showCodeInput: false
14 | };
15 |
16 | onSubmit = (values) => {
17 | alert(JSON.stringify(values, null, 2));
18 | window.setTimeout(()=>{this.props.navigation.navigate('ForgotPasswordConfirm')}, 3000);
19 | };
20 |
21 | render() {
22 | const initialValues = {
23 | username: '',
24 | };
25 | const VALIDATION_SCHEMA = Yup.object().shape({
26 | username: Yup.string().required('Required').min(3, 'Too short'),
27 | });
28 |
29 | return (
30 |
31 |
36 | {({handleChange, handleSubmit, values, errors, touched, handleBlur, isSubmitting}) => (
37 |
38 |
39 |
40 | Username *
41 |
42 |
50 | {errors.username && touched.username ? {errors.username} : null}
51 |
52 |
53 |
54 |
59 |
60 |
61 |
62 | )}
63 |
64 |
65 | );
66 | }
67 | }
68 |
69 | const border = StyleSheet.create({
70 | border: {
71 | borderWidth: 2,
72 | borderColor: 'red',
73 | }
74 | });
75 |
76 | const styles = StyleSheet.create({
77 | container: {
78 | flex: 1,
79 | marginHorizontal: 5,
80 | marginTop: 5
81 | },
82 | inputWrapper: {
83 | marginBottom: 20
84 | },
85 | input: {
86 | height: 50,
87 | borderWidth: 1,
88 | borderColor: 'black',
89 | borderRadius: 5,
90 | padding: 5,
91 | },
92 | error: {
93 | color: 'red',
94 | fontSize: 16
95 | },
96 | required: {
97 | color: 'red'
98 | }
99 | });
100 |
101 | export default ForgotPassword;
--------------------------------------------------------------------------------
/src/components/forgotPassword/ForgotPasswordConfirm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {View, Text, StyleSheet, TextInput, Button} from 'react-native';
3 | import {Formik} from 'formik';
4 | import * as Yup from 'yup';
5 |
6 | class ForgotPasswordConfirm extends Component {
7 | static navigationOptions = {
8 | header: null ,
9 | };
10 |
11 | onSubmit = (values) => {
12 | alert(JSON.stringify(values, null, 2));
13 | }
14 |
15 | render() {
16 | const initialValues = {
17 | username: '',
18 | confirmationCode: '',
19 | password: ''
20 | };
21 | const VALIDATION_SCHEMA = Yup.object().shape({
22 | username: Yup.string().required('Required').min(3, 'Too short'),
23 | confirmationCode: Yup.string().required('Required'),
24 | password: Yup.string().required('Required').min(8, 'Too short'),
25 | });
26 |
27 | return (
28 |
29 |
34 | {({handleChange, handleSubmit, values, errors, touched, handleBlur, isSubmitting}) => (
35 |
36 |
37 |
38 | Username *
39 |
40 |
48 | {errors.username && touched.username ? {errors.username} : null}
49 |
50 |
51 |
52 |
53 |
54 | Confirmation code *
55 |
56 |
64 | {errors.confirmationCode && touched.confirmationCode ? {errors.confirmationCode} : null}
65 |
66 |
67 |
68 |
69 | Password *
70 |
71 |
79 | {errors.password && touched.password ? {errors.password} : null}
80 |
81 |
82 |
87 |
88 |
89 | )}
90 |
91 |
92 |
93 | );
94 | }
95 | }
96 |
97 | const styles = StyleSheet.create({
98 | container: {
99 | flex: 1,
100 | marginHorizontal: 5,
101 | marginTop: 5
102 | },
103 | inputWrapper: {
104 | marginBottom: 20
105 | },
106 | input: {
107 | height: 50,
108 | borderWidth: 1,
109 | borderColor: 'black',
110 | borderRadius: 5,
111 | padding: 5,
112 | },
113 | error: {
114 | color: 'red',
115 | fontSize: 16
116 | },
117 | required: {
118 | color: 'red'
119 | }
120 | });
121 |
122 | export default ForgotPasswordConfirm;
--------------------------------------------------------------------------------
/src/components/helpers.js:
--------------------------------------------------------------------------------
1 | import PubSub from '@aws-amplify/pubsub';
2 | import config from "../../aws-exports";
3 | import API, {graphqlOperation} from "@aws-amplify/api";
4 |
5 | API.configure(config) ; // Configure Amplify
6 | PubSub.configure(config);
7 |
8 | export const graphQLOperation = (operation, payload) => {
9 | return API.graphql(graphqlOperation(operation, payload));
10 | };
11 |
--------------------------------------------------------------------------------
/src/components/reducers.js:
--------------------------------------------------------------------------------
1 | import {FETCH_QUERY_BEGINNING, FETCH_QUERY_SUCCESS,FETCH_QUERY_FAIL, ADD_TODOS, SUBSCRIPTION_ON_CREATE_TODO, SET_DIALOG, SUBSCRIPTION_ON_UPDATE_TODO} from "./actions";
2 |
3 | const initialState = {
4 | loading: false,
5 | todos: [],
6 | error: '',
7 | };
8 |
9 | const getIndex = (todos, todo) => {
10 | return todos.findIndex(elem => elem.id === todo.id);
11 | };
12 |
13 | const updateTodo = (todos, newTodo, index) => {
14 | if(index > 0)
15 | return todos;
16 | const newTodos = [...todos.slice(0, index), newTodo, ...todos.slice(index+1)];
17 | return newTodos;
18 | };
19 |
20 | const queryReducer = (state=initialState, action) => {
21 | const {type, payload} = action;
22 | console.log(state);
23 | console.log('reducers 13');
24 |
25 | switch (type) {
26 | case FETCH_QUERY_BEGINNING: return {...state, loading: true};
27 | case FETCH_QUERY_SUCCESS: return {...state, todos: payload.todos, loading: false};
28 | case FETCH_QUERY_FAIL: return {...state, error: payload.error};
29 | case ADD_TODOS: return {...state, todos: [...state.todos, ...payload.todos]};
30 | case SUBSCRIPTION_ON_CREATE_TODO: return {...state, todos: [...state.todos, payload.todo]};
31 | case SUBSCRIPTION_ON_UPDATE_TODO: {
32 | alert('at update');
33 | const {todos} = state;
34 | const {newTodo} = payload;
35 | return {...state, todos: updateTodo(todos, newTodo, getIndex(todos, newTodo))};
36 | }
37 | case SET_DIALOG: return {...state, showDialog: payload.showDialog, title: payload.title, message: payload.message};
38 | default: return state;
39 | }
40 | };
41 |
42 |
43 |
44 | export default queryReducer;
45 |
46 |
--------------------------------------------------------------------------------
/src/components/signIn/SignIn.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {StyleSheet, View, Text, Button, TextInput, SafeAreaView} from 'react-native';
3 | import {Auth} from 'aws-amplify';
4 | import {Formik} from 'formik';
5 | import * as Yup from 'yup';
6 |
7 | class SignIn extends Component {
8 | static navigationOptions = {
9 | title: 'Sign In',
10 | headerBackTitle: 'Back to sign in'
11 | };
12 |
13 | async signIn(userInputData) {
14 | const {username, password} = userInputData;
15 | try {
16 | const user = await Auth.signIn(username, password);
17 | console.log(user);
18 | console.log('SignIn 16');
19 | if (user.challengeName === 'SMS_MFA' ||
20 | user.challengeName === 'SOFTWARE_TOKEN_MFA') {
21 | alert(user.challengeName + ' signIn 17 at if(SMS_MFA || SOFTWARE_TOKEN_MFA)');
22 |
23 | // const code = getCodeFromUserInput();
24 | // const loggedUser = await Auth.confirmSignIn(
25 | // user,
26 | // code,
27 | // mfaType
28 | // );
29 | } else if (user.challengeName === 'NEW_PASSWORD_REQUIRED') {
30 | const {requiredAttributes} = user.challengeParam;
31 | alert(user.challengeName + ' signIn 30 at if(NEW_PASSWORD_REQUIRED)');
32 | // the array of required attributes, e.g ['email', 'phone_number']
33 | // const {username, email, phone_number} = getInfoFromUserInput();
34 | // const loggedUser = await Auth.completeNewPassword(
35 | // user,
36 | // newPassword,
37 | // {
38 | // email,
39 | // phone_number,
40 | // }
41 | // );
42 | } else if (user.challengeName === 'MFA_SETUP') {
43 | await Auth.setupTOTP(user);
44 | } else {
45 | console.log(user);
46 | console.log('SignIN 45');
47 | }
48 | } catch (err) {
49 | if (err.code === 'UserNotConfirmedException') {
50 | } else if (err.code === 'PasswordResetRequiredException') {
51 | } else if (err.code === 'NotAuthorizedException') {
52 | } else if (err.code === 'UserNotFoundException') {
53 | } else {
54 | console.log(err);
55 | }
56 | }
57 | };
58 |
59 | onSubmit = (values) => {
60 | alert(JSON.stringify(values, null, 2));
61 | console.log(values);
62 | console.log('values SignIn61');
63 | this.signIn(values)
64 | .then((response => {
65 | console.log(response);
66 | console.log('SignIn response 65');
67 | }))
68 | .catch(error => {
69 | console.log(error);
70 | console.log('SignIn response 65');
71 | });
72 | };
73 |
74 | render() {
75 | const {onSubmit} = this;
76 | const initialValues = {
77 | password: '',
78 | username: '',
79 | };
80 | const VALIDATION_SCHEMA = Yup.object().shape({
81 | password: Yup.string().required('Required').min(8, 'Too short'),
82 | username: Yup.string().required('Required').min(3, 'Too short'),
83 | });
84 |
85 | return (
86 |
87 |
92 | {({handleChange, handleSubmit, values, errors, touched, handleBlur, isSubmitting}) => (
93 |
94 |
95 |
96 | Username *
97 |
98 |
106 | {errors.username && touched.username ? {errors.username} : null}
107 |
108 |
109 |
110 |
111 | Password *
112 |
113 |
121 | {errors.password && touched.password ? {errors.password} : null}
122 |
123 |
124 |
125 | {alert('on Press')}}
128 | />
129 |
130 | { alert('handle submit'); handleSubmit()}}
133 | disabled={isSubmitting}
134 | />
135 |
136 |
137 |
138 |
139 | {this.props.navigation.navigate('ForgotPassword')}}
142 | />
143 |
144 |
145 |
146 | {this.props.navigation.navigate('SignUp')}}
149 |
150 | />
151 |
152 |
153 |
154 |
155 | )}
156 |
157 |
158 |
159 | );
160 | }
161 | }
162 |
163 | const border = StyleSheet.create({
164 | border: {
165 | borderWidth: 2,
166 | borderColor: 'red',
167 | }
168 | });
169 |
170 | const styles = StyleSheet.create({
171 | container: {
172 | flex: 1,
173 | marginHorizontal: 5,
174 | marginTop: 5
175 | // alignItems: 'center',
176 | },
177 | inputWrapper: {
178 | marginBottom: 20
179 | },
180 | input: {
181 | height: 50,
182 | borderWidth: 1,
183 | borderColor: 'black',
184 | borderRadius: 5,
185 | padding: 5,
186 | },
187 | error: {
188 | color: 'red',
189 | fontSize: 16
190 | },
191 | required: {
192 | color: 'red'
193 | },
194 | signInWrapper: {
195 | marginBottom: 20
196 | },
197 | buttonsInRowContainer: {
198 | flexDirection: 'row',
199 | justifyContent: 'center'
200 | },
201 | buttonWrapper: {
202 | marginHorizontal: 10
203 | }
204 | });
205 |
206 | export default SignIn;
--------------------------------------------------------------------------------
/src/components/signUp/SignUp.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {StyleSheet, View, Text, Button, TextInput, ScrollView, KeyboardAvoidingView} from 'react-native';
3 | import {Auth} from 'aws-amplify';
4 | import {Formik} from 'formik';
5 | import * as Yup from 'yup';
6 |
7 | class SignIn extends Component {
8 |
9 | signUp = userInputData => {
10 | const {username, password, email} = userInputData;
11 | Auth.signUp({
12 | username,
13 | password,
14 | attributes: {
15 | email, // optional
16 | // other custom attributes
17 | },
18 | })
19 | .then(data => {
20 | console.log(data);
21 | console.log('SignUp 22');
22 | })
23 | .catch(err => console.log(err));
24 | }
25 |
26 | onSubmit = (userInputData) => {
27 | alert(JSON.stringify(userInputData, null, 2));
28 | this.signUp(userInputData);
29 | };
30 | render() {
31 | const {onSubmit} = this;
32 | const initialValues = {
33 | email: '',
34 | password: '',
35 | firstName: '',
36 | phoneNumber: '',
37 | username: '',
38 | passwordConfirm: ''
39 | };
40 |
41 | const VALIDATION_SCHEMA = Yup.object().shape({
42 | email: Yup.string().required('Required').email('Email must be valid: example@mail.com'),
43 | password: Yup.string().required('Required').min(8, 'Too short'),
44 | firstName: Yup.string().required('Required').min(2, 'Too short'),
45 | phoneNumber: Yup.string().min(10, 'Too short'),
46 | username: Yup.string().required('Required').min(3, 'Too short'),
47 | passwordConfirm: Yup.string().min(8, 'Too short').oneOf([Yup.ref('password'), null], "Passwords must match")
48 | .required('Password confirm is required')
49 | });
50 |
51 | return (
52 |
53 |
56 |
57 |
62 | {({handleChange, handleSubmit, values, errors, touched, handleBlur, isSubmitting}) => (
63 |
64 |
65 |
66 | First name *
67 |
68 |
76 | {errors.firstName && touched.firstName ? {errors.firstName} : null}
77 |
78 |
79 |
80 |
81 | Email address *
82 |
83 |
91 | {errors.email && touched.email ? {errors.email} : null}
92 |
93 |
94 |
95 |
96 | Username *
97 |
98 |
106 | {errors.username && touched.username ? {errors.username} : null}
107 |
108 |
109 |
110 |
111 |
112 | Phone number
113 |
114 |
122 | {errors.phoneNumber && touched.phoneNumber ? {errors.phoneNumber} : null}
123 |
124 |
125 |
126 |
127 |
128 | Password *
129 |
130 |
138 | {errors.password && touched.password ? {errors.password} : null}
139 |
140 |
141 |
142 |
143 | Password confirm *
144 |
145 |
153 | {errors.passwordConfirm && touched.passwordConfirm ? {errors.passwordConfirm} : null}
154 |
155 |
156 |
157 | 0 && isSubmitting}
161 | />
162 |
163 |
164 | )}
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 | );
173 | }
174 | }
175 |
176 | const border = StyleSheet.create({
177 | border: {
178 | borderWidth: 2,
179 | borderColor: 'red',
180 | }
181 | });
182 |
183 | const styles = StyleSheet.create({
184 | container: {
185 | flex: 1,
186 | marginHorizontal: 5,
187 | marginTop: 5
188 | // alignItems: 'center',
189 | },
190 | inputWrapper: {
191 | marginBottom: 20
192 | },
193 | input: {
194 | height: 50,
195 | borderWidth: 1,
196 | borderColor: 'black',
197 | borderRadius: 5,
198 | padding: 5,
199 | },
200 | error: {
201 | color: 'red',
202 | fontSize: 16
203 | },
204 | required: {
205 | color: 'red'
206 | },
207 | buttonWrapper: {
208 | marginBottom: 15
209 | }
210 | });
211 |
212 | export default SignIn;
--------------------------------------------------------------------------------
/src/components/signUp/SignUpConfirm.js:
--------------------------------------------------------------------------------
1 | import React, {Component} from 'react';
2 | import {StyleSheet, View, Text, Button, TextInput, ScrollView, KeyboardAvoidingView} from 'react-native';
3 | import {Formik} from 'formik';
4 | import * as Yup from 'yup';
5 |
6 | class SignUpConfirm extends Component {
7 |
8 | onSubmit = (values) => {
9 | alert(JSON.stringify(values, null, 2));
10 | };
11 |
12 | render() {
13 | const initialValues = {
14 | username: '',
15 | confirmationCode: ''
16 | };
17 | const VALIDATION_SCHEMA = Yup.object().shape({
18 | username: Yup.string().required('Required').min(3, 'To short'),
19 | confirmationCode: Yup.string().required('required'),
20 | });
21 |
22 | return (
23 |
24 |
29 | {({handleChange, handleSubmit, values, errors, touched, handleBlur, isSubmitting}) => (
30 |
31 |
32 |
40 | {errors.username && touched.username ? {errors.username} : null}
41 |
42 |
47 |
48 |
49 | )}
50 |
51 |
52 |
53 |
54 | );
55 | }
56 | }
57 |
58 | const styles = StyleSheet.create({
59 | container: {
60 | flex: 1,
61 | marginHorizontal: 5,
62 | marginTop: 5
63 | // alignItems: 'center',
64 | },
65 | inputWrapper: {
66 | marginBottom: 20
67 | },
68 | input: {
69 | height: 50,
70 | borderWidth: 1,
71 | borderColor: 'black',
72 | borderRadius: 5,
73 | padding: 5,
74 | },
75 | error: {
76 | color: 'red',
77 | fontSize: 16
78 | },
79 | required: {
80 | color: 'red'
81 | }
82 | });
83 |
84 | export default SignUpConfirm;
--------------------------------------------------------------------------------
/src/components/store.js:
--------------------------------------------------------------------------------
1 | import {createStore, applyMiddleware, combineReducers} from "redux";
2 | import thunk from 'redux-thunk';
3 | import {composeWithDevTools} from "redux-devtools-extension";
4 | import queryReducer from './reducers';
5 | import {filterReducer} from './filterReducer';
6 | import dialog from './dialogReducer';
7 |
8 |
9 | export const store = createStore(combineReducers({
10 | queryReducer,
11 | filterReducer,
12 | dialog,
13 | }),
14 | composeWithDevTools(applyMiddleware(thunk))
15 | );
--------------------------------------------------------------------------------
/src/graphql/mutations.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | // this is an auto generated file. This will be overwritten
3 |
4 | export const createTodo = `mutation CreateTodo($input: CreateTodoInput!) {
5 | createTodo(input: $input) {
6 | id
7 | name
8 | description
9 | time
10 | completed
11 | }
12 | }
13 | `;
14 | export const updateTodo = `mutation UpdateTodo($input: UpdateTodoInput!) {
15 | updateTodo(input: $input) {
16 | id
17 | name
18 | description
19 | time
20 | completed
21 | }
22 | }
23 | `;
24 | export const deleteTodo = `mutation DeleteTodo($input: DeleteTodoInput!) {
25 | deleteTodo(input: $input) {
26 | id
27 | name
28 | description
29 | time
30 | completed
31 | }
32 | }
33 | `;
34 |
--------------------------------------------------------------------------------
/src/graphql/queries.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | // this is an auto generated file. This will be overwritten
3 |
4 | export const getTodo = `query GetTodo($id: ID!) {
5 | getTodo(id: $id) {
6 | id
7 | name
8 | description
9 | time
10 | completed
11 | }
12 | }
13 | `;
14 | export const listTodos = `query ListTodos(
15 | $filter: ModelTodoFilterInput
16 | $limit: Int
17 | $nextToken: String
18 | ) {
19 | listTodos(filter: $filter, limit: $limit, nextToken: $nextToken) {
20 | items {
21 | id
22 | name
23 | description
24 | time
25 | completed
26 | }
27 | nextToken
28 | }
29 | }
30 | `;
31 |
--------------------------------------------------------------------------------
/src/graphql/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "data" : {
3 | "__schema" : {
4 | "queryType" : {
5 | "name" : "Query"
6 | },
7 | "mutationType" : {
8 | "name" : "Mutation"
9 | },
10 | "subscriptionType" : {
11 | "name" : "Subscription"
12 | },
13 | "types" : [ {
14 | "kind" : "OBJECT",
15 | "name" : "Query",
16 | "description" : null,
17 | "fields" : [ {
18 | "name" : "getTodo",
19 | "description" : null,
20 | "args" : [ {
21 | "name" : "id",
22 | "description" : null,
23 | "type" : {
24 | "kind" : "NON_NULL",
25 | "name" : null,
26 | "ofType" : {
27 | "kind" : "SCALAR",
28 | "name" : "ID",
29 | "ofType" : null
30 | }
31 | },
32 | "defaultValue" : null
33 | } ],
34 | "type" : {
35 | "kind" : "OBJECT",
36 | "name" : "Todo",
37 | "ofType" : null
38 | },
39 | "isDeprecated" : false,
40 | "deprecationReason" : null
41 | }, {
42 | "name" : "listTodos",
43 | "description" : null,
44 | "args" : [ {
45 | "name" : "filter",
46 | "description" : null,
47 | "type" : {
48 | "kind" : "INPUT_OBJECT",
49 | "name" : "ModelTodoFilterInput",
50 | "ofType" : null
51 | },
52 | "defaultValue" : null
53 | }, {
54 | "name" : "limit",
55 | "description" : null,
56 | "type" : {
57 | "kind" : "SCALAR",
58 | "name" : "Int",
59 | "ofType" : null
60 | },
61 | "defaultValue" : null
62 | }, {
63 | "name" : "nextToken",
64 | "description" : null,
65 | "type" : {
66 | "kind" : "SCALAR",
67 | "name" : "String",
68 | "ofType" : null
69 | },
70 | "defaultValue" : null
71 | } ],
72 | "type" : {
73 | "kind" : "OBJECT",
74 | "name" : "ModelTodoConnection",
75 | "ofType" : null
76 | },
77 | "isDeprecated" : false,
78 | "deprecationReason" : null
79 | } ],
80 | "inputFields" : null,
81 | "interfaces" : [ ],
82 | "enumValues" : null,
83 | "possibleTypes" : null
84 | }, {
85 | "kind" : "OBJECT",
86 | "name" : "Todo",
87 | "description" : null,
88 | "fields" : [ {
89 | "name" : "id",
90 | "description" : null,
91 | "args" : [ ],
92 | "type" : {
93 | "kind" : "NON_NULL",
94 | "name" : null,
95 | "ofType" : {
96 | "kind" : "SCALAR",
97 | "name" : "ID",
98 | "ofType" : null
99 | }
100 | },
101 | "isDeprecated" : false,
102 | "deprecationReason" : null
103 | }, {
104 | "name" : "name",
105 | "description" : null,
106 | "args" : [ ],
107 | "type" : {
108 | "kind" : "NON_NULL",
109 | "name" : null,
110 | "ofType" : {
111 | "kind" : "SCALAR",
112 | "name" : "String",
113 | "ofType" : null
114 | }
115 | },
116 | "isDeprecated" : false,
117 | "deprecationReason" : null
118 | }, {
119 | "name" : "description",
120 | "description" : null,
121 | "args" : [ ],
122 | "type" : {
123 | "kind" : "SCALAR",
124 | "name" : "String",
125 | "ofType" : null
126 | },
127 | "isDeprecated" : false,
128 | "deprecationReason" : null
129 | }, {
130 | "name" : "time",
131 | "description" : null,
132 | "args" : [ ],
133 | "type" : {
134 | "kind" : "SCALAR",
135 | "name" : "String",
136 | "ofType" : null
137 | },
138 | "isDeprecated" : false,
139 | "deprecationReason" : null
140 | }, {
141 | "name" : "completed",
142 | "description" : null,
143 | "args" : [ ],
144 | "type" : {
145 | "kind" : "SCALAR",
146 | "name" : "Boolean",
147 | "ofType" : null
148 | },
149 | "isDeprecated" : false,
150 | "deprecationReason" : null
151 | } ],
152 | "inputFields" : null,
153 | "interfaces" : [ ],
154 | "enumValues" : null,
155 | "possibleTypes" : null
156 | }, {
157 | "kind" : "SCALAR",
158 | "name" : "ID",
159 | "description" : "Built-in ID",
160 | "fields" : null,
161 | "inputFields" : null,
162 | "interfaces" : null,
163 | "enumValues" : null,
164 | "possibleTypes" : null
165 | }, {
166 | "kind" : "SCALAR",
167 | "name" : "String",
168 | "description" : "Built-in String",
169 | "fields" : null,
170 | "inputFields" : null,
171 | "interfaces" : null,
172 | "enumValues" : null,
173 | "possibleTypes" : null
174 | }, {
175 | "kind" : "SCALAR",
176 | "name" : "Boolean",
177 | "description" : "Built-in Boolean",
178 | "fields" : null,
179 | "inputFields" : null,
180 | "interfaces" : null,
181 | "enumValues" : null,
182 | "possibleTypes" : null
183 | }, {
184 | "kind" : "OBJECT",
185 | "name" : "ModelTodoConnection",
186 | "description" : null,
187 | "fields" : [ {
188 | "name" : "items",
189 | "description" : null,
190 | "args" : [ ],
191 | "type" : {
192 | "kind" : "LIST",
193 | "name" : null,
194 | "ofType" : {
195 | "kind" : "OBJECT",
196 | "name" : "Todo",
197 | "ofType" : null
198 | }
199 | },
200 | "isDeprecated" : false,
201 | "deprecationReason" : null
202 | }, {
203 | "name" : "nextToken",
204 | "description" : null,
205 | "args" : [ ],
206 | "type" : {
207 | "kind" : "SCALAR",
208 | "name" : "String",
209 | "ofType" : null
210 | },
211 | "isDeprecated" : false,
212 | "deprecationReason" : null
213 | } ],
214 | "inputFields" : null,
215 | "interfaces" : [ ],
216 | "enumValues" : null,
217 | "possibleTypes" : null
218 | }, {
219 | "kind" : "INPUT_OBJECT",
220 | "name" : "ModelTodoFilterInput",
221 | "description" : null,
222 | "fields" : null,
223 | "inputFields" : [ {
224 | "name" : "id",
225 | "description" : null,
226 | "type" : {
227 | "kind" : "INPUT_OBJECT",
228 | "name" : "ModelIDFilterInput",
229 | "ofType" : null
230 | },
231 | "defaultValue" : null
232 | }, {
233 | "name" : "name",
234 | "description" : null,
235 | "type" : {
236 | "kind" : "INPUT_OBJECT",
237 | "name" : "ModelStringFilterInput",
238 | "ofType" : null
239 | },
240 | "defaultValue" : null
241 | }, {
242 | "name" : "description",
243 | "description" : null,
244 | "type" : {
245 | "kind" : "INPUT_OBJECT",
246 | "name" : "ModelStringFilterInput",
247 | "ofType" : null
248 | },
249 | "defaultValue" : null
250 | }, {
251 | "name" : "time",
252 | "description" : null,
253 | "type" : {
254 | "kind" : "INPUT_OBJECT",
255 | "name" : "ModelStringFilterInput",
256 | "ofType" : null
257 | },
258 | "defaultValue" : null
259 | }, {
260 | "name" : "completed",
261 | "description" : null,
262 | "type" : {
263 | "kind" : "INPUT_OBJECT",
264 | "name" : "ModelBooleanFilterInput",
265 | "ofType" : null
266 | },
267 | "defaultValue" : null
268 | }, {
269 | "name" : "and",
270 | "description" : null,
271 | "type" : {
272 | "kind" : "LIST",
273 | "name" : null,
274 | "ofType" : {
275 | "kind" : "INPUT_OBJECT",
276 | "name" : "ModelTodoFilterInput",
277 | "ofType" : null
278 | }
279 | },
280 | "defaultValue" : null
281 | }, {
282 | "name" : "or",
283 | "description" : null,
284 | "type" : {
285 | "kind" : "LIST",
286 | "name" : null,
287 | "ofType" : {
288 | "kind" : "INPUT_OBJECT",
289 | "name" : "ModelTodoFilterInput",
290 | "ofType" : null
291 | }
292 | },
293 | "defaultValue" : null
294 | }, {
295 | "name" : "not",
296 | "description" : null,
297 | "type" : {
298 | "kind" : "INPUT_OBJECT",
299 | "name" : "ModelTodoFilterInput",
300 | "ofType" : null
301 | },
302 | "defaultValue" : null
303 | } ],
304 | "interfaces" : null,
305 | "enumValues" : null,
306 | "possibleTypes" : null
307 | }, {
308 | "kind" : "INPUT_OBJECT",
309 | "name" : "ModelIDFilterInput",
310 | "description" : null,
311 | "fields" : null,
312 | "inputFields" : [ {
313 | "name" : "ne",
314 | "description" : null,
315 | "type" : {
316 | "kind" : "SCALAR",
317 | "name" : "ID",
318 | "ofType" : null
319 | },
320 | "defaultValue" : null
321 | }, {
322 | "name" : "eq",
323 | "description" : null,
324 | "type" : {
325 | "kind" : "SCALAR",
326 | "name" : "ID",
327 | "ofType" : null
328 | },
329 | "defaultValue" : null
330 | }, {
331 | "name" : "le",
332 | "description" : null,
333 | "type" : {
334 | "kind" : "SCALAR",
335 | "name" : "ID",
336 | "ofType" : null
337 | },
338 | "defaultValue" : null
339 | }, {
340 | "name" : "lt",
341 | "description" : null,
342 | "type" : {
343 | "kind" : "SCALAR",
344 | "name" : "ID",
345 | "ofType" : null
346 | },
347 | "defaultValue" : null
348 | }, {
349 | "name" : "ge",
350 | "description" : null,
351 | "type" : {
352 | "kind" : "SCALAR",
353 | "name" : "ID",
354 | "ofType" : null
355 | },
356 | "defaultValue" : null
357 | }, {
358 | "name" : "gt",
359 | "description" : null,
360 | "type" : {
361 | "kind" : "SCALAR",
362 | "name" : "ID",
363 | "ofType" : null
364 | },
365 | "defaultValue" : null
366 | }, {
367 | "name" : "contains",
368 | "description" : null,
369 | "type" : {
370 | "kind" : "SCALAR",
371 | "name" : "ID",
372 | "ofType" : null
373 | },
374 | "defaultValue" : null
375 | }, {
376 | "name" : "notContains",
377 | "description" : null,
378 | "type" : {
379 | "kind" : "SCALAR",
380 | "name" : "ID",
381 | "ofType" : null
382 | },
383 | "defaultValue" : null
384 | }, {
385 | "name" : "between",
386 | "description" : null,
387 | "type" : {
388 | "kind" : "LIST",
389 | "name" : null,
390 | "ofType" : {
391 | "kind" : "SCALAR",
392 | "name" : "ID",
393 | "ofType" : null
394 | }
395 | },
396 | "defaultValue" : null
397 | }, {
398 | "name" : "beginsWith",
399 | "description" : null,
400 | "type" : {
401 | "kind" : "SCALAR",
402 | "name" : "ID",
403 | "ofType" : null
404 | },
405 | "defaultValue" : null
406 | } ],
407 | "interfaces" : null,
408 | "enumValues" : null,
409 | "possibleTypes" : null
410 | }, {
411 | "kind" : "INPUT_OBJECT",
412 | "name" : "ModelStringFilterInput",
413 | "description" : null,
414 | "fields" : null,
415 | "inputFields" : [ {
416 | "name" : "ne",
417 | "description" : null,
418 | "type" : {
419 | "kind" : "SCALAR",
420 | "name" : "String",
421 | "ofType" : null
422 | },
423 | "defaultValue" : null
424 | }, {
425 | "name" : "eq",
426 | "description" : null,
427 | "type" : {
428 | "kind" : "SCALAR",
429 | "name" : "String",
430 | "ofType" : null
431 | },
432 | "defaultValue" : null
433 | }, {
434 | "name" : "le",
435 | "description" : null,
436 | "type" : {
437 | "kind" : "SCALAR",
438 | "name" : "String",
439 | "ofType" : null
440 | },
441 | "defaultValue" : null
442 | }, {
443 | "name" : "lt",
444 | "description" : null,
445 | "type" : {
446 | "kind" : "SCALAR",
447 | "name" : "String",
448 | "ofType" : null
449 | },
450 | "defaultValue" : null
451 | }, {
452 | "name" : "ge",
453 | "description" : null,
454 | "type" : {
455 | "kind" : "SCALAR",
456 | "name" : "String",
457 | "ofType" : null
458 | },
459 | "defaultValue" : null
460 | }, {
461 | "name" : "gt",
462 | "description" : null,
463 | "type" : {
464 | "kind" : "SCALAR",
465 | "name" : "String",
466 | "ofType" : null
467 | },
468 | "defaultValue" : null
469 | }, {
470 | "name" : "contains",
471 | "description" : null,
472 | "type" : {
473 | "kind" : "SCALAR",
474 | "name" : "String",
475 | "ofType" : null
476 | },
477 | "defaultValue" : null
478 | }, {
479 | "name" : "notContains",
480 | "description" : null,
481 | "type" : {
482 | "kind" : "SCALAR",
483 | "name" : "String",
484 | "ofType" : null
485 | },
486 | "defaultValue" : null
487 | }, {
488 | "name" : "between",
489 | "description" : null,
490 | "type" : {
491 | "kind" : "LIST",
492 | "name" : null,
493 | "ofType" : {
494 | "kind" : "SCALAR",
495 | "name" : "String",
496 | "ofType" : null
497 | }
498 | },
499 | "defaultValue" : null
500 | }, {
501 | "name" : "beginsWith",
502 | "description" : null,
503 | "type" : {
504 | "kind" : "SCALAR",
505 | "name" : "String",
506 | "ofType" : null
507 | },
508 | "defaultValue" : null
509 | } ],
510 | "interfaces" : null,
511 | "enumValues" : null,
512 | "possibleTypes" : null
513 | }, {
514 | "kind" : "INPUT_OBJECT",
515 | "name" : "ModelBooleanFilterInput",
516 | "description" : null,
517 | "fields" : null,
518 | "inputFields" : [ {
519 | "name" : "ne",
520 | "description" : null,
521 | "type" : {
522 | "kind" : "SCALAR",
523 | "name" : "Boolean",
524 | "ofType" : null
525 | },
526 | "defaultValue" : null
527 | }, {
528 | "name" : "eq",
529 | "description" : null,
530 | "type" : {
531 | "kind" : "SCALAR",
532 | "name" : "Boolean",
533 | "ofType" : null
534 | },
535 | "defaultValue" : null
536 | } ],
537 | "interfaces" : null,
538 | "enumValues" : null,
539 | "possibleTypes" : null
540 | }, {
541 | "kind" : "SCALAR",
542 | "name" : "Int",
543 | "description" : "Built-in Int",
544 | "fields" : null,
545 | "inputFields" : null,
546 | "interfaces" : null,
547 | "enumValues" : null,
548 | "possibleTypes" : null
549 | }, {
550 | "kind" : "OBJECT",
551 | "name" : "Mutation",
552 | "description" : null,
553 | "fields" : [ {
554 | "name" : "createTodo",
555 | "description" : null,
556 | "args" : [ {
557 | "name" : "input",
558 | "description" : null,
559 | "type" : {
560 | "kind" : "NON_NULL",
561 | "name" : null,
562 | "ofType" : {
563 | "kind" : "INPUT_OBJECT",
564 | "name" : "CreateTodoInput",
565 | "ofType" : null
566 | }
567 | },
568 | "defaultValue" : null
569 | } ],
570 | "type" : {
571 | "kind" : "OBJECT",
572 | "name" : "Todo",
573 | "ofType" : null
574 | },
575 | "isDeprecated" : false,
576 | "deprecationReason" : null
577 | }, {
578 | "name" : "updateTodo",
579 | "description" : null,
580 | "args" : [ {
581 | "name" : "input",
582 | "description" : null,
583 | "type" : {
584 | "kind" : "NON_NULL",
585 | "name" : null,
586 | "ofType" : {
587 | "kind" : "INPUT_OBJECT",
588 | "name" : "UpdateTodoInput",
589 | "ofType" : null
590 | }
591 | },
592 | "defaultValue" : null
593 | } ],
594 | "type" : {
595 | "kind" : "OBJECT",
596 | "name" : "Todo",
597 | "ofType" : null
598 | },
599 | "isDeprecated" : false,
600 | "deprecationReason" : null
601 | }, {
602 | "name" : "deleteTodo",
603 | "description" : null,
604 | "args" : [ {
605 | "name" : "input",
606 | "description" : null,
607 | "type" : {
608 | "kind" : "NON_NULL",
609 | "name" : null,
610 | "ofType" : {
611 | "kind" : "INPUT_OBJECT",
612 | "name" : "DeleteTodoInput",
613 | "ofType" : null
614 | }
615 | },
616 | "defaultValue" : null
617 | } ],
618 | "type" : {
619 | "kind" : "OBJECT",
620 | "name" : "Todo",
621 | "ofType" : null
622 | },
623 | "isDeprecated" : false,
624 | "deprecationReason" : null
625 | } ],
626 | "inputFields" : null,
627 | "interfaces" : [ ],
628 | "enumValues" : null,
629 | "possibleTypes" : null
630 | }, {
631 | "kind" : "INPUT_OBJECT",
632 | "name" : "CreateTodoInput",
633 | "description" : null,
634 | "fields" : null,
635 | "inputFields" : [ {
636 | "name" : "id",
637 | "description" : null,
638 | "type" : {
639 | "kind" : "SCALAR",
640 | "name" : "ID",
641 | "ofType" : null
642 | },
643 | "defaultValue" : null
644 | }, {
645 | "name" : "name",
646 | "description" : null,
647 | "type" : {
648 | "kind" : "NON_NULL",
649 | "name" : null,
650 | "ofType" : {
651 | "kind" : "SCALAR",
652 | "name" : "String",
653 | "ofType" : null
654 | }
655 | },
656 | "defaultValue" : null
657 | }, {
658 | "name" : "description",
659 | "description" : null,
660 | "type" : {
661 | "kind" : "SCALAR",
662 | "name" : "String",
663 | "ofType" : null
664 | },
665 | "defaultValue" : null
666 | }, {
667 | "name" : "time",
668 | "description" : null,
669 | "type" : {
670 | "kind" : "SCALAR",
671 | "name" : "String",
672 | "ofType" : null
673 | },
674 | "defaultValue" : null
675 | }, {
676 | "name" : "completed",
677 | "description" : null,
678 | "type" : {
679 | "kind" : "SCALAR",
680 | "name" : "Boolean",
681 | "ofType" : null
682 | },
683 | "defaultValue" : null
684 | } ],
685 | "interfaces" : null,
686 | "enumValues" : null,
687 | "possibleTypes" : null
688 | }, {
689 | "kind" : "INPUT_OBJECT",
690 | "name" : "UpdateTodoInput",
691 | "description" : null,
692 | "fields" : null,
693 | "inputFields" : [ {
694 | "name" : "id",
695 | "description" : null,
696 | "type" : {
697 | "kind" : "NON_NULL",
698 | "name" : null,
699 | "ofType" : {
700 | "kind" : "SCALAR",
701 | "name" : "ID",
702 | "ofType" : null
703 | }
704 | },
705 | "defaultValue" : null
706 | }, {
707 | "name" : "name",
708 | "description" : null,
709 | "type" : {
710 | "kind" : "SCALAR",
711 | "name" : "String",
712 | "ofType" : null
713 | },
714 | "defaultValue" : null
715 | }, {
716 | "name" : "description",
717 | "description" : null,
718 | "type" : {
719 | "kind" : "SCALAR",
720 | "name" : "String",
721 | "ofType" : null
722 | },
723 | "defaultValue" : null
724 | }, {
725 | "name" : "time",
726 | "description" : null,
727 | "type" : {
728 | "kind" : "SCALAR",
729 | "name" : "String",
730 | "ofType" : null
731 | },
732 | "defaultValue" : null
733 | }, {
734 | "name" : "completed",
735 | "description" : null,
736 | "type" : {
737 | "kind" : "SCALAR",
738 | "name" : "Boolean",
739 | "ofType" : null
740 | },
741 | "defaultValue" : null
742 | } ],
743 | "interfaces" : null,
744 | "enumValues" : null,
745 | "possibleTypes" : null
746 | }, {
747 | "kind" : "INPUT_OBJECT",
748 | "name" : "DeleteTodoInput",
749 | "description" : null,
750 | "fields" : null,
751 | "inputFields" : [ {
752 | "name" : "id",
753 | "description" : null,
754 | "type" : {
755 | "kind" : "SCALAR",
756 | "name" : "ID",
757 | "ofType" : null
758 | },
759 | "defaultValue" : null
760 | } ],
761 | "interfaces" : null,
762 | "enumValues" : null,
763 | "possibleTypes" : null
764 | }, {
765 | "kind" : "OBJECT",
766 | "name" : "Subscription",
767 | "description" : null,
768 | "fields" : [ {
769 | "name" : "onCreateTodo",
770 | "description" : null,
771 | "args" : [ ],
772 | "type" : {
773 | "kind" : "OBJECT",
774 | "name" : "Todo",
775 | "ofType" : null
776 | },
777 | "isDeprecated" : false,
778 | "deprecationReason" : null
779 | }, {
780 | "name" : "onUpdateTodo",
781 | "description" : null,
782 | "args" : [ ],
783 | "type" : {
784 | "kind" : "OBJECT",
785 | "name" : "Todo",
786 | "ofType" : null
787 | },
788 | "isDeprecated" : false,
789 | "deprecationReason" : null
790 | }, {
791 | "name" : "onDeleteTodo",
792 | "description" : null,
793 | "args" : [ ],
794 | "type" : {
795 | "kind" : "OBJECT",
796 | "name" : "Todo",
797 | "ofType" : null
798 | },
799 | "isDeprecated" : false,
800 | "deprecationReason" : null
801 | } ],
802 | "inputFields" : null,
803 | "interfaces" : [ ],
804 | "enumValues" : null,
805 | "possibleTypes" : null
806 | }, {
807 | "kind" : "INPUT_OBJECT",
808 | "name" : "ModelIntFilterInput",
809 | "description" : null,
810 | "fields" : null,
811 | "inputFields" : [ {
812 | "name" : "ne",
813 | "description" : null,
814 | "type" : {
815 | "kind" : "SCALAR",
816 | "name" : "Int",
817 | "ofType" : null
818 | },
819 | "defaultValue" : null
820 | }, {
821 | "name" : "eq",
822 | "description" : null,
823 | "type" : {
824 | "kind" : "SCALAR",
825 | "name" : "Int",
826 | "ofType" : null
827 | },
828 | "defaultValue" : null
829 | }, {
830 | "name" : "le",
831 | "description" : null,
832 | "type" : {
833 | "kind" : "SCALAR",
834 | "name" : "Int",
835 | "ofType" : null
836 | },
837 | "defaultValue" : null
838 | }, {
839 | "name" : "lt",
840 | "description" : null,
841 | "type" : {
842 | "kind" : "SCALAR",
843 | "name" : "Int",
844 | "ofType" : null
845 | },
846 | "defaultValue" : null
847 | }, {
848 | "name" : "ge",
849 | "description" : null,
850 | "type" : {
851 | "kind" : "SCALAR",
852 | "name" : "Int",
853 | "ofType" : null
854 | },
855 | "defaultValue" : null
856 | }, {
857 | "name" : "gt",
858 | "description" : null,
859 | "type" : {
860 | "kind" : "SCALAR",
861 | "name" : "Int",
862 | "ofType" : null
863 | },
864 | "defaultValue" : null
865 | }, {
866 | "name" : "contains",
867 | "description" : null,
868 | "type" : {
869 | "kind" : "SCALAR",
870 | "name" : "Int",
871 | "ofType" : null
872 | },
873 | "defaultValue" : null
874 | }, {
875 | "name" : "notContains",
876 | "description" : null,
877 | "type" : {
878 | "kind" : "SCALAR",
879 | "name" : "Int",
880 | "ofType" : null
881 | },
882 | "defaultValue" : null
883 | }, {
884 | "name" : "between",
885 | "description" : null,
886 | "type" : {
887 | "kind" : "LIST",
888 | "name" : null,
889 | "ofType" : {
890 | "kind" : "SCALAR",
891 | "name" : "Int",
892 | "ofType" : null
893 | }
894 | },
895 | "defaultValue" : null
896 | } ],
897 | "interfaces" : null,
898 | "enumValues" : null,
899 | "possibleTypes" : null
900 | }, {
901 | "kind" : "INPUT_OBJECT",
902 | "name" : "ModelFloatFilterInput",
903 | "description" : null,
904 | "fields" : null,
905 | "inputFields" : [ {
906 | "name" : "ne",
907 | "description" : null,
908 | "type" : {
909 | "kind" : "SCALAR",
910 | "name" : "Float",
911 | "ofType" : null
912 | },
913 | "defaultValue" : null
914 | }, {
915 | "name" : "eq",
916 | "description" : null,
917 | "type" : {
918 | "kind" : "SCALAR",
919 | "name" : "Float",
920 | "ofType" : null
921 | },
922 | "defaultValue" : null
923 | }, {
924 | "name" : "le",
925 | "description" : null,
926 | "type" : {
927 | "kind" : "SCALAR",
928 | "name" : "Float",
929 | "ofType" : null
930 | },
931 | "defaultValue" : null
932 | }, {
933 | "name" : "lt",
934 | "description" : null,
935 | "type" : {
936 | "kind" : "SCALAR",
937 | "name" : "Float",
938 | "ofType" : null
939 | },
940 | "defaultValue" : null
941 | }, {
942 | "name" : "ge",
943 | "description" : null,
944 | "type" : {
945 | "kind" : "SCALAR",
946 | "name" : "Float",
947 | "ofType" : null
948 | },
949 | "defaultValue" : null
950 | }, {
951 | "name" : "gt",
952 | "description" : null,
953 | "type" : {
954 | "kind" : "SCALAR",
955 | "name" : "Float",
956 | "ofType" : null
957 | },
958 | "defaultValue" : null
959 | }, {
960 | "name" : "contains",
961 | "description" : null,
962 | "type" : {
963 | "kind" : "SCALAR",
964 | "name" : "Float",
965 | "ofType" : null
966 | },
967 | "defaultValue" : null
968 | }, {
969 | "name" : "notContains",
970 | "description" : null,
971 | "type" : {
972 | "kind" : "SCALAR",
973 | "name" : "Float",
974 | "ofType" : null
975 | },
976 | "defaultValue" : null
977 | }, {
978 | "name" : "between",
979 | "description" : null,
980 | "type" : {
981 | "kind" : "LIST",
982 | "name" : null,
983 | "ofType" : {
984 | "kind" : "SCALAR",
985 | "name" : "Float",
986 | "ofType" : null
987 | }
988 | },
989 | "defaultValue" : null
990 | } ],
991 | "interfaces" : null,
992 | "enumValues" : null,
993 | "possibleTypes" : null
994 | }, {
995 | "kind" : "SCALAR",
996 | "name" : "Float",
997 | "description" : "Built-in Float",
998 | "fields" : null,
999 | "inputFields" : null,
1000 | "interfaces" : null,
1001 | "enumValues" : null,
1002 | "possibleTypes" : null
1003 | }, {
1004 | "kind" : "ENUM",
1005 | "name" : "ModelSortDirection",
1006 | "description" : null,
1007 | "fields" : null,
1008 | "inputFields" : null,
1009 | "interfaces" : null,
1010 | "enumValues" : [ {
1011 | "name" : "ASC",
1012 | "description" : null,
1013 | "isDeprecated" : false,
1014 | "deprecationReason" : null
1015 | }, {
1016 | "name" : "DESC",
1017 | "description" : null,
1018 | "isDeprecated" : false,
1019 | "deprecationReason" : null
1020 | } ],
1021 | "possibleTypes" : null
1022 | }, {
1023 | "kind" : "OBJECT",
1024 | "name" : "__Schema",
1025 | "description" : "A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.",
1026 | "fields" : [ {
1027 | "name" : "types",
1028 | "description" : "A list of all types supported by this server.",
1029 | "args" : [ ],
1030 | "type" : {
1031 | "kind" : "NON_NULL",
1032 | "name" : null,
1033 | "ofType" : {
1034 | "kind" : "LIST",
1035 | "name" : null,
1036 | "ofType" : {
1037 | "kind" : "NON_NULL",
1038 | "name" : null,
1039 | "ofType" : {
1040 | "kind" : "OBJECT",
1041 | "name" : "__Type",
1042 | "ofType" : null
1043 | }
1044 | }
1045 | }
1046 | },
1047 | "isDeprecated" : false,
1048 | "deprecationReason" : null
1049 | }, {
1050 | "name" : "queryType",
1051 | "description" : "The type that query operations will be rooted at.",
1052 | "args" : [ ],
1053 | "type" : {
1054 | "kind" : "NON_NULL",
1055 | "name" : null,
1056 | "ofType" : {
1057 | "kind" : "OBJECT",
1058 | "name" : "__Type",
1059 | "ofType" : null
1060 | }
1061 | },
1062 | "isDeprecated" : false,
1063 | "deprecationReason" : null
1064 | }, {
1065 | "name" : "mutationType",
1066 | "description" : "If this server supports mutation, the type that mutation operations will be rooted at.",
1067 | "args" : [ ],
1068 | "type" : {
1069 | "kind" : "OBJECT",
1070 | "name" : "__Type",
1071 | "ofType" : null
1072 | },
1073 | "isDeprecated" : false,
1074 | "deprecationReason" : null
1075 | }, {
1076 | "name" : "directives",
1077 | "description" : "'A list of all directives supported by this server.",
1078 | "args" : [ ],
1079 | "type" : {
1080 | "kind" : "NON_NULL",
1081 | "name" : null,
1082 | "ofType" : {
1083 | "kind" : "LIST",
1084 | "name" : null,
1085 | "ofType" : {
1086 | "kind" : "NON_NULL",
1087 | "name" : null,
1088 | "ofType" : {
1089 | "kind" : "OBJECT",
1090 | "name" : "__Directive",
1091 | "ofType" : null
1092 | }
1093 | }
1094 | }
1095 | },
1096 | "isDeprecated" : false,
1097 | "deprecationReason" : null
1098 | }, {
1099 | "name" : "subscriptionType",
1100 | "description" : "'If this server support subscription, the type that subscription operations will be rooted at.",
1101 | "args" : [ ],
1102 | "type" : {
1103 | "kind" : "OBJECT",
1104 | "name" : "__Type",
1105 | "ofType" : null
1106 | },
1107 | "isDeprecated" : false,
1108 | "deprecationReason" : null
1109 | } ],
1110 | "inputFields" : null,
1111 | "interfaces" : [ ],
1112 | "enumValues" : null,
1113 | "possibleTypes" : null
1114 | }, {
1115 | "kind" : "OBJECT",
1116 | "name" : "__Type",
1117 | "description" : null,
1118 | "fields" : [ {
1119 | "name" : "kind",
1120 | "description" : null,
1121 | "args" : [ ],
1122 | "type" : {
1123 | "kind" : "NON_NULL",
1124 | "name" : null,
1125 | "ofType" : {
1126 | "kind" : "ENUM",
1127 | "name" : "__TypeKind",
1128 | "ofType" : null
1129 | }
1130 | },
1131 | "isDeprecated" : false,
1132 | "deprecationReason" : null
1133 | }, {
1134 | "name" : "name",
1135 | "description" : null,
1136 | "args" : [ ],
1137 | "type" : {
1138 | "kind" : "SCALAR",
1139 | "name" : "String",
1140 | "ofType" : null
1141 | },
1142 | "isDeprecated" : false,
1143 | "deprecationReason" : null
1144 | }, {
1145 | "name" : "description",
1146 | "description" : null,
1147 | "args" : [ ],
1148 | "type" : {
1149 | "kind" : "SCALAR",
1150 | "name" : "String",
1151 | "ofType" : null
1152 | },
1153 | "isDeprecated" : false,
1154 | "deprecationReason" : null
1155 | }, {
1156 | "name" : "fields",
1157 | "description" : null,
1158 | "args" : [ {
1159 | "name" : "includeDeprecated",
1160 | "description" : null,
1161 | "type" : {
1162 | "kind" : "SCALAR",
1163 | "name" : "Boolean",
1164 | "ofType" : null
1165 | },
1166 | "defaultValue" : "false"
1167 | } ],
1168 | "type" : {
1169 | "kind" : "LIST",
1170 | "name" : null,
1171 | "ofType" : {
1172 | "kind" : "NON_NULL",
1173 | "name" : null,
1174 | "ofType" : {
1175 | "kind" : "OBJECT",
1176 | "name" : "__Field",
1177 | "ofType" : null
1178 | }
1179 | }
1180 | },
1181 | "isDeprecated" : false,
1182 | "deprecationReason" : null
1183 | }, {
1184 | "name" : "interfaces",
1185 | "description" : null,
1186 | "args" : [ ],
1187 | "type" : {
1188 | "kind" : "LIST",
1189 | "name" : null,
1190 | "ofType" : {
1191 | "kind" : "NON_NULL",
1192 | "name" : null,
1193 | "ofType" : {
1194 | "kind" : "OBJECT",
1195 | "name" : "__Type",
1196 | "ofType" : null
1197 | }
1198 | }
1199 | },
1200 | "isDeprecated" : false,
1201 | "deprecationReason" : null
1202 | }, {
1203 | "name" : "possibleTypes",
1204 | "description" : null,
1205 | "args" : [ ],
1206 | "type" : {
1207 | "kind" : "LIST",
1208 | "name" : null,
1209 | "ofType" : {
1210 | "kind" : "NON_NULL",
1211 | "name" : null,
1212 | "ofType" : {
1213 | "kind" : "OBJECT",
1214 | "name" : "__Type",
1215 | "ofType" : null
1216 | }
1217 | }
1218 | },
1219 | "isDeprecated" : false,
1220 | "deprecationReason" : null
1221 | }, {
1222 | "name" : "enumValues",
1223 | "description" : null,
1224 | "args" : [ {
1225 | "name" : "includeDeprecated",
1226 | "description" : null,
1227 | "type" : {
1228 | "kind" : "SCALAR",
1229 | "name" : "Boolean",
1230 | "ofType" : null
1231 | },
1232 | "defaultValue" : "false"
1233 | } ],
1234 | "type" : {
1235 | "kind" : "LIST",
1236 | "name" : null,
1237 | "ofType" : {
1238 | "kind" : "NON_NULL",
1239 | "name" : null,
1240 | "ofType" : {
1241 | "kind" : "OBJECT",
1242 | "name" : "__EnumValue",
1243 | "ofType" : null
1244 | }
1245 | }
1246 | },
1247 | "isDeprecated" : false,
1248 | "deprecationReason" : null
1249 | }, {
1250 | "name" : "inputFields",
1251 | "description" : null,
1252 | "args" : [ ],
1253 | "type" : {
1254 | "kind" : "LIST",
1255 | "name" : null,
1256 | "ofType" : {
1257 | "kind" : "NON_NULL",
1258 | "name" : null,
1259 | "ofType" : {
1260 | "kind" : "OBJECT",
1261 | "name" : "__InputValue",
1262 | "ofType" : null
1263 | }
1264 | }
1265 | },
1266 | "isDeprecated" : false,
1267 | "deprecationReason" : null
1268 | }, {
1269 | "name" : "ofType",
1270 | "description" : null,
1271 | "args" : [ ],
1272 | "type" : {
1273 | "kind" : "OBJECT",
1274 | "name" : "__Type",
1275 | "ofType" : null
1276 | },
1277 | "isDeprecated" : false,
1278 | "deprecationReason" : null
1279 | } ],
1280 | "inputFields" : null,
1281 | "interfaces" : [ ],
1282 | "enumValues" : null,
1283 | "possibleTypes" : null
1284 | }, {
1285 | "kind" : "ENUM",
1286 | "name" : "__TypeKind",
1287 | "description" : "An enum describing what kind of type a given __Type is",
1288 | "fields" : null,
1289 | "inputFields" : null,
1290 | "interfaces" : null,
1291 | "enumValues" : [ {
1292 | "name" : "SCALAR",
1293 | "description" : "Indicates this type is a scalar.",
1294 | "isDeprecated" : false,
1295 | "deprecationReason" : null
1296 | }, {
1297 | "name" : "OBJECT",
1298 | "description" : "Indicates this type is an object. `fields` and `interfaces` are valid fields.",
1299 | "isDeprecated" : false,
1300 | "deprecationReason" : null
1301 | }, {
1302 | "name" : "INTERFACE",
1303 | "description" : "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.",
1304 | "isDeprecated" : false,
1305 | "deprecationReason" : null
1306 | }, {
1307 | "name" : "UNION",
1308 | "description" : "Indicates this type is a union. `possibleTypes` is a valid field.",
1309 | "isDeprecated" : false,
1310 | "deprecationReason" : null
1311 | }, {
1312 | "name" : "ENUM",
1313 | "description" : "Indicates this type is an enum. `enumValues` is a valid field.",
1314 | "isDeprecated" : false,
1315 | "deprecationReason" : null
1316 | }, {
1317 | "name" : "INPUT_OBJECT",
1318 | "description" : "Indicates this type is an input object. `inputFields` is a valid field.",
1319 | "isDeprecated" : false,
1320 | "deprecationReason" : null
1321 | }, {
1322 | "name" : "LIST",
1323 | "description" : "Indicates this type is a list. `ofType` is a valid field.",
1324 | "isDeprecated" : false,
1325 | "deprecationReason" : null
1326 | }, {
1327 | "name" : "NON_NULL",
1328 | "description" : "Indicates this type is a non-null. `ofType` is a valid field.",
1329 | "isDeprecated" : false,
1330 | "deprecationReason" : null
1331 | } ],
1332 | "possibleTypes" : null
1333 | }, {
1334 | "kind" : "OBJECT",
1335 | "name" : "__Field",
1336 | "description" : null,
1337 | "fields" : [ {
1338 | "name" : "name",
1339 | "description" : null,
1340 | "args" : [ ],
1341 | "type" : {
1342 | "kind" : "NON_NULL",
1343 | "name" : null,
1344 | "ofType" : {
1345 | "kind" : "SCALAR",
1346 | "name" : "String",
1347 | "ofType" : null
1348 | }
1349 | },
1350 | "isDeprecated" : false,
1351 | "deprecationReason" : null
1352 | }, {
1353 | "name" : "description",
1354 | "description" : null,
1355 | "args" : [ ],
1356 | "type" : {
1357 | "kind" : "SCALAR",
1358 | "name" : "String",
1359 | "ofType" : null
1360 | },
1361 | "isDeprecated" : false,
1362 | "deprecationReason" : null
1363 | }, {
1364 | "name" : "args",
1365 | "description" : null,
1366 | "args" : [ ],
1367 | "type" : {
1368 | "kind" : "NON_NULL",
1369 | "name" : null,
1370 | "ofType" : {
1371 | "kind" : "LIST",
1372 | "name" : null,
1373 | "ofType" : {
1374 | "kind" : "NON_NULL",
1375 | "name" : null,
1376 | "ofType" : {
1377 | "kind" : "OBJECT",
1378 | "name" : "__InputValue",
1379 | "ofType" : null
1380 | }
1381 | }
1382 | }
1383 | },
1384 | "isDeprecated" : false,
1385 | "deprecationReason" : null
1386 | }, {
1387 | "name" : "type",
1388 | "description" : null,
1389 | "args" : [ ],
1390 | "type" : {
1391 | "kind" : "NON_NULL",
1392 | "name" : null,
1393 | "ofType" : {
1394 | "kind" : "OBJECT",
1395 | "name" : "__Type",
1396 | "ofType" : null
1397 | }
1398 | },
1399 | "isDeprecated" : false,
1400 | "deprecationReason" : null
1401 | }, {
1402 | "name" : "isDeprecated",
1403 | "description" : null,
1404 | "args" : [ ],
1405 | "type" : {
1406 | "kind" : "NON_NULL",
1407 | "name" : null,
1408 | "ofType" : {
1409 | "kind" : "SCALAR",
1410 | "name" : "Boolean",
1411 | "ofType" : null
1412 | }
1413 | },
1414 | "isDeprecated" : false,
1415 | "deprecationReason" : null
1416 | }, {
1417 | "name" : "deprecationReason",
1418 | "description" : null,
1419 | "args" : [ ],
1420 | "type" : {
1421 | "kind" : "SCALAR",
1422 | "name" : "String",
1423 | "ofType" : null
1424 | },
1425 | "isDeprecated" : false,
1426 | "deprecationReason" : null
1427 | } ],
1428 | "inputFields" : null,
1429 | "interfaces" : [ ],
1430 | "enumValues" : null,
1431 | "possibleTypes" : null
1432 | }, {
1433 | "kind" : "OBJECT",
1434 | "name" : "__InputValue",
1435 | "description" : null,
1436 | "fields" : [ {
1437 | "name" : "name",
1438 | "description" : null,
1439 | "args" : [ ],
1440 | "type" : {
1441 | "kind" : "NON_NULL",
1442 | "name" : null,
1443 | "ofType" : {
1444 | "kind" : "SCALAR",
1445 | "name" : "String",
1446 | "ofType" : null
1447 | }
1448 | },
1449 | "isDeprecated" : false,
1450 | "deprecationReason" : null
1451 | }, {
1452 | "name" : "description",
1453 | "description" : null,
1454 | "args" : [ ],
1455 | "type" : {
1456 | "kind" : "SCALAR",
1457 | "name" : "String",
1458 | "ofType" : null
1459 | },
1460 | "isDeprecated" : false,
1461 | "deprecationReason" : null
1462 | }, {
1463 | "name" : "type",
1464 | "description" : null,
1465 | "args" : [ ],
1466 | "type" : {
1467 | "kind" : "NON_NULL",
1468 | "name" : null,
1469 | "ofType" : {
1470 | "kind" : "OBJECT",
1471 | "name" : "__Type",
1472 | "ofType" : null
1473 | }
1474 | },
1475 | "isDeprecated" : false,
1476 | "deprecationReason" : null
1477 | }, {
1478 | "name" : "defaultValue",
1479 | "description" : null,
1480 | "args" : [ ],
1481 | "type" : {
1482 | "kind" : "SCALAR",
1483 | "name" : "String",
1484 | "ofType" : null
1485 | },
1486 | "isDeprecated" : false,
1487 | "deprecationReason" : null
1488 | } ],
1489 | "inputFields" : null,
1490 | "interfaces" : [ ],
1491 | "enumValues" : null,
1492 | "possibleTypes" : null
1493 | }, {
1494 | "kind" : "OBJECT",
1495 | "name" : "__EnumValue",
1496 | "description" : null,
1497 | "fields" : [ {
1498 | "name" : "name",
1499 | "description" : null,
1500 | "args" : [ ],
1501 | "type" : {
1502 | "kind" : "NON_NULL",
1503 | "name" : null,
1504 | "ofType" : {
1505 | "kind" : "SCALAR",
1506 | "name" : "String",
1507 | "ofType" : null
1508 | }
1509 | },
1510 | "isDeprecated" : false,
1511 | "deprecationReason" : null
1512 | }, {
1513 | "name" : "description",
1514 | "description" : null,
1515 | "args" : [ ],
1516 | "type" : {
1517 | "kind" : "SCALAR",
1518 | "name" : "String",
1519 | "ofType" : null
1520 | },
1521 | "isDeprecated" : false,
1522 | "deprecationReason" : null
1523 | }, {
1524 | "name" : "isDeprecated",
1525 | "description" : null,
1526 | "args" : [ ],
1527 | "type" : {
1528 | "kind" : "NON_NULL",
1529 | "name" : null,
1530 | "ofType" : {
1531 | "kind" : "SCALAR",
1532 | "name" : "Boolean",
1533 | "ofType" : null
1534 | }
1535 | },
1536 | "isDeprecated" : false,
1537 | "deprecationReason" : null
1538 | }, {
1539 | "name" : "deprecationReason",
1540 | "description" : null,
1541 | "args" : [ ],
1542 | "type" : {
1543 | "kind" : "SCALAR",
1544 | "name" : "String",
1545 | "ofType" : null
1546 | },
1547 | "isDeprecated" : false,
1548 | "deprecationReason" : null
1549 | } ],
1550 | "inputFields" : null,
1551 | "interfaces" : [ ],
1552 | "enumValues" : null,
1553 | "possibleTypes" : null
1554 | }, {
1555 | "kind" : "OBJECT",
1556 | "name" : "__Directive",
1557 | "description" : null,
1558 | "fields" : [ {
1559 | "name" : "name",
1560 | "description" : null,
1561 | "args" : [ ],
1562 | "type" : {
1563 | "kind" : "SCALAR",
1564 | "name" : "String",
1565 | "ofType" : null
1566 | },
1567 | "isDeprecated" : false,
1568 | "deprecationReason" : null
1569 | }, {
1570 | "name" : "description",
1571 | "description" : null,
1572 | "args" : [ ],
1573 | "type" : {
1574 | "kind" : "SCALAR",
1575 | "name" : "String",
1576 | "ofType" : null
1577 | },
1578 | "isDeprecated" : false,
1579 | "deprecationReason" : null
1580 | }, {
1581 | "name" : "locations",
1582 | "description" : null,
1583 | "args" : [ ],
1584 | "type" : {
1585 | "kind" : "LIST",
1586 | "name" : null,
1587 | "ofType" : {
1588 | "kind" : "NON_NULL",
1589 | "name" : null,
1590 | "ofType" : {
1591 | "kind" : "ENUM",
1592 | "name" : "__DirectiveLocation",
1593 | "ofType" : null
1594 | }
1595 | }
1596 | },
1597 | "isDeprecated" : false,
1598 | "deprecationReason" : null
1599 | }, {
1600 | "name" : "args",
1601 | "description" : null,
1602 | "args" : [ ],
1603 | "type" : {
1604 | "kind" : "NON_NULL",
1605 | "name" : null,
1606 | "ofType" : {
1607 | "kind" : "LIST",
1608 | "name" : null,
1609 | "ofType" : {
1610 | "kind" : "NON_NULL",
1611 | "name" : null,
1612 | "ofType" : {
1613 | "kind" : "OBJECT",
1614 | "name" : "__InputValue",
1615 | "ofType" : null
1616 | }
1617 | }
1618 | }
1619 | },
1620 | "isDeprecated" : false,
1621 | "deprecationReason" : null
1622 | }, {
1623 | "name" : "onOperation",
1624 | "description" : null,
1625 | "args" : [ ],
1626 | "type" : {
1627 | "kind" : "SCALAR",
1628 | "name" : "Boolean",
1629 | "ofType" : null
1630 | },
1631 | "isDeprecated" : true,
1632 | "deprecationReason" : "Use `locations`."
1633 | }, {
1634 | "name" : "onFragment",
1635 | "description" : null,
1636 | "args" : [ ],
1637 | "type" : {
1638 | "kind" : "SCALAR",
1639 | "name" : "Boolean",
1640 | "ofType" : null
1641 | },
1642 | "isDeprecated" : true,
1643 | "deprecationReason" : "Use `locations`."
1644 | }, {
1645 | "name" : "onField",
1646 | "description" : null,
1647 | "args" : [ ],
1648 | "type" : {
1649 | "kind" : "SCALAR",
1650 | "name" : "Boolean",
1651 | "ofType" : null
1652 | },
1653 | "isDeprecated" : true,
1654 | "deprecationReason" : "Use `locations`."
1655 | } ],
1656 | "inputFields" : null,
1657 | "interfaces" : [ ],
1658 | "enumValues" : null,
1659 | "possibleTypes" : null
1660 | }, {
1661 | "kind" : "ENUM",
1662 | "name" : "__DirectiveLocation",
1663 | "description" : "An enum describing valid locations where a directive can be placed",
1664 | "fields" : null,
1665 | "inputFields" : null,
1666 | "interfaces" : null,
1667 | "enumValues" : [ {
1668 | "name" : "QUERY",
1669 | "description" : "Indicates the directive is valid on queries.",
1670 | "isDeprecated" : false,
1671 | "deprecationReason" : null
1672 | }, {
1673 | "name" : "MUTATION",
1674 | "description" : "Indicates the directive is valid on mutations.",
1675 | "isDeprecated" : false,
1676 | "deprecationReason" : null
1677 | }, {
1678 | "name" : "FIELD",
1679 | "description" : "Indicates the directive is valid on fields.",
1680 | "isDeprecated" : false,
1681 | "deprecationReason" : null
1682 | }, {
1683 | "name" : "FRAGMENT_DEFINITION",
1684 | "description" : "Indicates the directive is valid on fragment definitions.",
1685 | "isDeprecated" : false,
1686 | "deprecationReason" : null
1687 | }, {
1688 | "name" : "FRAGMENT_SPREAD",
1689 | "description" : "Indicates the directive is valid on fragment spreads.",
1690 | "isDeprecated" : false,
1691 | "deprecationReason" : null
1692 | }, {
1693 | "name" : "INLINE_FRAGMENT",
1694 | "description" : "Indicates the directive is valid on inline fragments.",
1695 | "isDeprecated" : false,
1696 | "deprecationReason" : null
1697 | }, {
1698 | "name" : "SCHEMA",
1699 | "description" : "Indicates the directive is valid on a schema SDL definition.",
1700 | "isDeprecated" : false,
1701 | "deprecationReason" : null
1702 | }, {
1703 | "name" : "SCALAR",
1704 | "description" : "Indicates the directive is valid on a scalar SDL definition.",
1705 | "isDeprecated" : false,
1706 | "deprecationReason" : null
1707 | }, {
1708 | "name" : "OBJECT",
1709 | "description" : "Indicates the directive is valid on an object SDL definition.",
1710 | "isDeprecated" : false,
1711 | "deprecationReason" : null
1712 | }, {
1713 | "name" : "FIELD_DEFINITION",
1714 | "description" : "Indicates the directive is valid on a field SDL definition.",
1715 | "isDeprecated" : false,
1716 | "deprecationReason" : null
1717 | }, {
1718 | "name" : "ARGUMENT_DEFINITION",
1719 | "description" : "Indicates the directive is valid on a field argument SDL definition.",
1720 | "isDeprecated" : false,
1721 | "deprecationReason" : null
1722 | }, {
1723 | "name" : "INTERFACE",
1724 | "description" : "Indicates the directive is valid on an interface SDL definition.",
1725 | "isDeprecated" : false,
1726 | "deprecationReason" : null
1727 | }, {
1728 | "name" : "UNION",
1729 | "description" : "Indicates the directive is valid on an union SDL definition.",
1730 | "isDeprecated" : false,
1731 | "deprecationReason" : null
1732 | }, {
1733 | "name" : "ENUM",
1734 | "description" : "Indicates the directive is valid on an enum SDL definition.",
1735 | "isDeprecated" : false,
1736 | "deprecationReason" : null
1737 | }, {
1738 | "name" : "ENUM_VALUE",
1739 | "description" : "Indicates the directive is valid on an enum value SDL definition.",
1740 | "isDeprecated" : false,
1741 | "deprecationReason" : null
1742 | }, {
1743 | "name" : "INPUT_OBJECT",
1744 | "description" : "Indicates the directive is valid on an input object SDL definition.",
1745 | "isDeprecated" : false,
1746 | "deprecationReason" : null
1747 | }, {
1748 | "name" : "INPUT_FIELD_DEFINITION",
1749 | "description" : "Indicates the directive is valid on an input object field SDL definition.",
1750 | "isDeprecated" : false,
1751 | "deprecationReason" : null
1752 | } ],
1753 | "possibleTypes" : null
1754 | } ],
1755 | "directives" : [ {
1756 | "name" : "include",
1757 | "description" : "Directs the executor to include this field or fragment only when the `if` argument is true",
1758 | "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ],
1759 | "args" : [ {
1760 | "name" : "if",
1761 | "description" : "Included when true.",
1762 | "type" : {
1763 | "kind" : "NON_NULL",
1764 | "name" : null,
1765 | "ofType" : {
1766 | "kind" : "SCALAR",
1767 | "name" : "Boolean",
1768 | "ofType" : null
1769 | }
1770 | },
1771 | "defaultValue" : null
1772 | } ],
1773 | "onOperation" : false,
1774 | "onFragment" : true,
1775 | "onField" : true
1776 | }, {
1777 | "name" : "skip",
1778 | "description" : "Directs the executor to skip this field or fragment when the `if`'argument is true.",
1779 | "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ],
1780 | "args" : [ {
1781 | "name" : "if",
1782 | "description" : "Skipped when true.",
1783 | "type" : {
1784 | "kind" : "NON_NULL",
1785 | "name" : null,
1786 | "ofType" : {
1787 | "kind" : "SCALAR",
1788 | "name" : "Boolean",
1789 | "ofType" : null
1790 | }
1791 | },
1792 | "defaultValue" : null
1793 | } ],
1794 | "onOperation" : false,
1795 | "onFragment" : true,
1796 | "onField" : true
1797 | }, {
1798 | "name" : "defer",
1799 | "description" : "This directive allows results to be deferred during execution",
1800 | "locations" : [ "FIELD" ],
1801 | "args" : [ ],
1802 | "onOperation" : false,
1803 | "onFragment" : false,
1804 | "onField" : true
1805 | }, {
1806 | "name" : "aws_iam",
1807 | "description" : "Tells the service this field/object has access authorized by sigv4 signing.",
1808 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ],
1809 | "args" : [ ],
1810 | "onOperation" : false,
1811 | "onFragment" : false,
1812 | "onField" : false
1813 | }, {
1814 | "name" : "aws_publish",
1815 | "description" : "Tells the service which subscriptions will be published to when this mutation is called. This directive is deprecated use @aws_susbscribe directive instead.",
1816 | "locations" : [ "FIELD_DEFINITION" ],
1817 | "args" : [ {
1818 | "name" : "subscriptions",
1819 | "description" : "List of subscriptions which will be published to when this mutation is called.",
1820 | "type" : {
1821 | "kind" : "LIST",
1822 | "name" : null,
1823 | "ofType" : {
1824 | "kind" : "SCALAR",
1825 | "name" : "String",
1826 | "ofType" : null
1827 | }
1828 | },
1829 | "defaultValue" : null
1830 | } ],
1831 | "onOperation" : false,
1832 | "onFragment" : false,
1833 | "onField" : false
1834 | }, {
1835 | "name" : "deprecated",
1836 | "description" : null,
1837 | "locations" : [ "FIELD_DEFINITION", "ENUM_VALUE" ],
1838 | "args" : [ {
1839 | "name" : "reason",
1840 | "description" : null,
1841 | "type" : {
1842 | "kind" : "SCALAR",
1843 | "name" : "String",
1844 | "ofType" : null
1845 | },
1846 | "defaultValue" : "\"No longer supported\""
1847 | } ],
1848 | "onOperation" : false,
1849 | "onFragment" : false,
1850 | "onField" : false
1851 | }, {
1852 | "name" : "aws_api_key",
1853 | "description" : "Tells the service this field/object has access authorized by an API key.",
1854 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ],
1855 | "args" : [ ],
1856 | "onOperation" : false,
1857 | "onFragment" : false,
1858 | "onField" : false
1859 | }, {
1860 | "name" : "aws_oidc",
1861 | "description" : "Tells the service this field/object has access authorized by an OIDC token.",
1862 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ],
1863 | "args" : [ ],
1864 | "onOperation" : false,
1865 | "onFragment" : false,
1866 | "onField" : false
1867 | }, {
1868 | "name" : "aws_cognito_user_pools",
1869 | "description" : "Tells the service this field/object has access authorized by a Cognito User Pools token.",
1870 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ],
1871 | "args" : [ {
1872 | "name" : "cognito_groups",
1873 | "description" : "List of cognito user pool groups which have access on this field",
1874 | "type" : {
1875 | "kind" : "LIST",
1876 | "name" : null,
1877 | "ofType" : {
1878 | "kind" : "SCALAR",
1879 | "name" : "String",
1880 | "ofType" : null
1881 | }
1882 | },
1883 | "defaultValue" : null
1884 | } ],
1885 | "onOperation" : false,
1886 | "onFragment" : false,
1887 | "onField" : false
1888 | }, {
1889 | "name" : "aws_auth",
1890 | "description" : "Directs the schema to enforce authorization on a field",
1891 | "locations" : [ "FIELD_DEFINITION" ],
1892 | "args" : [ {
1893 | "name" : "cognito_groups",
1894 | "description" : "List of cognito user pool groups which have access on this field",
1895 | "type" : {
1896 | "kind" : "LIST",
1897 | "name" : null,
1898 | "ofType" : {
1899 | "kind" : "SCALAR",
1900 | "name" : "String",
1901 | "ofType" : null
1902 | }
1903 | },
1904 | "defaultValue" : null
1905 | } ],
1906 | "onOperation" : false,
1907 | "onFragment" : false,
1908 | "onField" : false
1909 | }, {
1910 | "name" : "aws_subscribe",
1911 | "description" : "Tells the service which mutation triggers this subscription.",
1912 | "locations" : [ "FIELD_DEFINITION" ],
1913 | "args" : [ {
1914 | "name" : "mutations",
1915 | "description" : "List of mutations which will trigger this subscription when they are called.",
1916 | "type" : {
1917 | "kind" : "LIST",
1918 | "name" : null,
1919 | "ofType" : {
1920 | "kind" : "SCALAR",
1921 | "name" : "String",
1922 | "ofType" : null
1923 | }
1924 | },
1925 | "defaultValue" : null
1926 | } ],
1927 | "onOperation" : false,
1928 | "onFragment" : false,
1929 | "onField" : false
1930 | } ]
1931 | }
1932 | }
1933 | }
--------------------------------------------------------------------------------
/src/graphql/subscriptions.js:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | // this is an auto generated file. This will be overwritten
3 |
4 | export const onCreateTodo = `subscription OnCreateTodo {
5 | onCreateTodo {
6 | id
7 | name
8 | description
9 | time
10 | completed
11 | }
12 | }
13 | `;
14 | export const onUpdateTodo = `subscription OnUpdateTodo {
15 | onUpdateTodo {
16 | id
17 | name
18 | description
19 | time
20 | completed
21 | }
22 | }
23 | `;
24 | export const onDeleteTodo = `subscription OnDeleteTodo {
25 | onDeleteTodo {
26 | id
27 | name
28 | description
29 | time
30 | completed
31 | }
32 | }
33 | `;
34 |
--------------------------------------------------------------------------------
/src/navigation/appFlowNav.js:
--------------------------------------------------------------------------------
1 | import {createStackNavigator} from "react-navigation-stack";
2 | import HomeScreen from "../screens/HomeScreen";
3 |
4 | const routeConfigs = {
5 | Home: {
6 | screen: HomeScreen
7 | },
8 | };
9 |
10 | const stackNavigatorConfig = {
11 | initialRouteName: 'Home',
12 | };
13 |
14 | const appStackNavigator = createStackNavigator(routeConfigs, stackNavigatorConfig);
15 |
16 | export default appStackNavigator;
--------------------------------------------------------------------------------
/src/navigation/authNavigation.js:
--------------------------------------------------------------------------------
1 | import {createStackNavigator} from "react-navigation-stack";
2 | import SignIn from "../components/signIn/SignIn";
3 | import SignUp from '../components/signUp/SignUp';
4 | import ForgotPassword from "../components/forgotPassword/ForgotPassword";
5 | import ForgotPasswordConfirm from "../components/forgotPassword/ForgotPasswordConfirm";
6 |
7 | const routeConfigs = {
8 | SignIn: {
9 | screen: SignIn
10 | },
11 | SignUp: {
12 | screen: SignUp
13 | },
14 | ForgotPassword: {
15 | screen: ForgotPassword,
16 | },
17 | ForgotPasswordConfirm: {
18 | screen: ForgotPasswordConfirm,
19 | }
20 | };
21 |
22 | const stackNavigatorConfig = {
23 | initialRouteName: 'SignIn',
24 | };
25 |
26 | const authStackNavigator = createStackNavigator(routeConfigs, stackNavigatorConfig);
27 |
28 | export default authStackNavigator;
--------------------------------------------------------------------------------
/src/navigation/forgotPassword.js:
--------------------------------------------------------------------------------
1 | import {createStackNavigator} from "react-navigation-stack";
2 | import {createSwitchNavigator} from "react-navigation";
3 | import ForgotPassword from '../components/forgotPassword/ForgotPassword';
4 | import ForgotPasswordConfirm from "../components/forgotPassword/ForgotPasswordConfirm";
5 |
6 | const routeConfig = {
7 | ForgotPassword: {
8 | screen: ForgotPassword,
9 | },
10 | ForgotPasswordConfirm: {
11 | screen: ForgotPasswordConfirm,
12 | }
13 | };
14 |
15 | const navigatorConfig = {
16 | initialRouteName: 'ForgotPassword'
17 | };
18 |
19 | const forgotPasswordNavigation = createSwitchNavigator(routeConfig, navigatorConfig);
20 | export default forgotPasswordNavigation;
--------------------------------------------------------------------------------
/src/navigation/index.js:
--------------------------------------------------------------------------------
1 | import {createSwitchNavigator, createAppContainer} from "react-navigation";
2 | import authNavigation from "./authNavigation";
3 | import appFlowNav from "./appFlowNav";
4 |
5 |
6 | const routeConfig = {
7 | Auth: {
8 | screen: authNavigation,
9 | },
10 | App: {
11 | screen: appFlowNav
12 | }
13 | };
14 |
15 | const switchNavigatorConfig = {
16 | initialRouteName: 'Auth',
17 | };
18 |
19 | const switchNavigator = createSwitchNavigator(routeConfig, switchNavigatorConfig);
20 |
21 | export default createAppContainer(switchNavigator);
--------------------------------------------------------------------------------
/src/screens/HomeScreen.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import {View} from 'react-native';
3 | import Header from "../components/Header";
4 | import Todos from "../components/Todos";
5 | import Bottom from "../components/Bottom";
6 |
7 | const HomeScreen = (props) => {
8 | return (
9 |
10 |
11 |
12 |
13 | {console.log(props)}
14 | {console.log('HomeScreen 14')}
15 |
16 | );
17 | };
18 |
19 | export default HomeScreen;
--------------------------------------------------------------------------------