forked from slappforge/simple-authenticator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappState.json
1 lines (1 loc) · 7.71 KB
/
appState.json
1
{"EDITOR_STATE":{"allProjectFiles":{"6b62ae10-8931-47a3-baa6-958f52e066f8":{"id":"6b62ae10-8931-47a3-baa6-958f52e066f8","parent":null,"name":"simple-authenticator-sigma-sample","type":"DIRECTORY","isDirectory":true,"children":["b25cfaa4-4d44-4464-83f9-5b8ff3d06549","4a2466e7-d4da-40a4-b57c-d0cb6aa6b0b4","ef6a3550-9c0a-44a1-a422-dbb21d93168c"],"isRemovable":false,"filePath":"simple-authenticator-sigma-sample"},"b25cfaa4-4d44-4464-83f9-5b8ff3d06549":{"id":"b25cfaa4-4d44-4464-83f9-5b8ff3d06549","parent":"6b62ae10-8931-47a3-baa6-958f52e066f8","name":"signup-lambda.js","type":"LAMBDA_FILE","isDirectory":false,"children":[],"isRemovable":true,"filePath":"simple-authenticator-sigma-sample/signup-lambda.js","code":"let AWS = require('aws-sdk');\nlet connectionManager = require('./ConnectionManager');\nlet SL = require('@slappforge/slappforge-sdk');\nconst rds = new SL.AWS.RDS(connectionManager);\nexports.handler = function (event, context, callback) {\n\n let response;\n\tlet inserts = [event.email, event.password, event.lastName, event.firstName, event.address]; \n\t// Replace the query with the actual query\n\t// You can pass the existing connection to this function.\n\t// A new connection will be created if it's not present as the third param \n\t// You must always end the DB connection after it's used\n\trds.query({\n\t\tinstanceIdentifier: 'authDatabase',\n\t\tquery: 'INSERT INTO users (Email, Password, LastName, FirstName, Address) VALUES (?, ?, ?, ?, ?);',\n\t\tinserts: inserts\n\t}, function (error, results, connection) {\n\t\tif (error) {\n\t\t\tresponse = error;\n\t\t\tthrow error;\n\t\t} else {\n\t\t\tresponse = \"Successfully added a new user with email\";\n\t\t\tconsole.log(results);\n\t\t}\n\t\tconnection.end();\n\t\tcallback(null, response);\n\t});\n}","resources":["rds-authDatabase","apigusEast1authApisigninpost"],"triggers":[{"resourceName":"apigusEast1authApisignuppost","config":{}}],"version":1},"4a2466e7-d4da-40a4-b57c-d0cb6aa6b0b4":{"id":"4a2466e7-d4da-40a4-b57c-d0cb6aa6b0b4","parent":"6b62ae10-8931-47a3-baa6-958f52e066f8","name":"ConnectionManager.js","type":"JS_FILE","isDirectory":false,"children":[],"isRemovable":true,"filePath":"simple-authenticator-sigma-sample/ConnectionManager.js","code":"module.exports=function(){\n\n this.dbConnections = [];\n \n this.dbConnections[\"authDatabase\"] = {\n host: process.env.EndPoint_rdsAuthDatabase,\n port: process.env.Port_rdsAuthDatabase,\n user: process.env.User_rdsAuthDatabase,\n password: process.env.Password_rdsAuthDatabase,\n database: \"authDatabase\"\n };\n};","resources":[],"triggers":[],"version":1},"ef6a3550-9c0a-44a1-a422-dbb21d93168c":{"id":"ef6a3550-9c0a-44a1-a422-dbb21d93168c","parent":"6b62ae10-8931-47a3-baa6-958f52e066f8","name":"signin-lambda.js","type":"LAMBDA_FILE","isDirectory":false,"children":[],"isRemovable":true,"filePath":"simple-authenticator-sigma-sample/signin-lambda.js","code":"let AWS = require('aws-sdk');\nlet connectionManager = require('./ConnectionManager');\nlet SL = require('@slappforge/slappforge-sdk');\nconst rds = new SL.AWS.RDS(connectionManager);\nexports.handler = function (event, context, callback) {\n\n let successfullyLoggedIn = false;\n\tlet inserts = [event.email, event.password];\n\t// Replace the query with the actual query\n\t// You can pass the existing connection to this function.\n\t// A new connection will be created if it's not present as the third param \n\t// You must always end the DB connection after it's used\n\trds.query({\n\t\tinstanceIdentifier: 'authDatabase',\n\t\tquery: 'SELECT * FROM users WHERE Email = ? AND Password = ?',\n\t\tinserts: inserts\n\t}, function (error, results, connection) {\n\t\tif (error) {\n\t\t\tthrow error;\n\t\t} else {\n\t\t\tsuccessfullyLoggedIn = results.length > 0;\n\t\t}\n\n\t\tconnection.end();\n\t\tcallback(null, successfullyLoggedIn);\n\t});\n}","resources":["rds-mobilebackend"],"triggers":[{"resourceName":"apigusEast1authApisigninpost","config":{"selectedRegion":"us-east-1","apiMode":0,"apiName":"mobile-signin-sample-api","endpointType":"EDGE","resourceMode":0,"resourceName":"signin","resourcePath":"/signin","restMethod":"POST","proxyIntegration":false,"stageMode":0,"stageName":"prod"}}],"version":1}},"rootNode":"6b62ae10-8931-47a3-baa6-958f52e066f8","openFiles":["b25cfaa4-4d44-4464-83f9-5b8ff3d06549","ef6a3550-9c0a-44a1-a422-dbb21d93168c","4a2466e7-d4da-40a4-b57c-d0cb6aa6b0b4"],"currentFileId":"b25cfaa4-4d44-4464-83f9-5b8ff3d06549","resources":{"rds-authDatabase":{"name":"rds-authDatabase","type":"RDS","config":{"operation":0,"editMode":true,"rdsInstance":{"rdsEngineType":"mysql","rdsEdition":"","rdsInstanceSpec":{"dbInstanceClass":"db.t2.micro","dbLicenseModel":"general-public-license","dbEngineVersion":"5.7.19"},"rdsSetting":{"instanceIdentifier":"authDatabase","masterUsername":"rdsuser","masterPassword":"12345678"},"rdsDBOptions":{"dbName":"authDatabase","dbPort":"3306"},"rdsInstanceArn":"","Host":"process.env.EndPoint_authDatabase","doesExist":false,"initializationQuery":"CREATE TABLE users\n(\nUserId int NOT NULL AUTO_INCREMENT,\nEmail varchar(255) NOT NULL UNIQUE,\nPassword varchar(255) NOT NULL,\nLastName varchar(255),\nFirstName varchar(255),\nAddress varchar(255),\nPRIMARY KEY (UserId)\n);"},"rdsInstanceResources":[],"mode":0,"projectRegion":"us-east-1","additionalFiles":[],"params":{"query":"INSERT INTO users (Email, Password, LastName, FirstName, Address) VALUES (?, ?, ?, ?, ?);","inserts":"\"randikanavagamuwa@gmail.com\",\"password\",\"Navagamuwa\",\"Randika\",\"Colombo\""},"isGlobalEditMode":false,"enableInject":true,"isNewFromGlobal":false},"globallyEditable":true,"usage":{"b25cfaa4-4d44-4464-83f9-5b8ff3d06549":{"operations":{"query":[{"instanceIdentifier":"authDatabase","query":"INSERT INTO users (Email, Password, LastName, FirstName, Address) VALUES (?, ?, ?, ?, ?);","inserts":"@{inserts}"}]},"occurrence":1,"triggers":[]},"ef6a3550-9c0a-44a1-a422-dbb21d93168c":{"operations":{"query":[{"instanceIdentifier":"authDatabase","query":"SELECT * FROM users WHERE Email = ? AND Password = ?","inserts":"@{inserts}"}]},"occurrence":1,"triggers":[]}}},"apigusEast1authApisigninpost":{"name":"apigusEast1authApisigninpost","type":"API_GATEWAY","config":{"selectedRegion":"us-east-1","apiMode":0,"apiName":"auth-api","endpointType":"EDGE","resourceMode":0,"resourceName":"signin","resourcePath":"/signin","restMethod":"POST","proxyIntegration":false,"stageMode":0,"stageName":"prod"},"globallyEditable":true,"usage":{"ef6a3550-9c0a-44a1-a422-dbb21d93168c":{"operations":{},"occurrence":1,"triggers":[{"selectedRegion":"us-east-1","apiMode":0,"apiName":"mobile-signin-sample-api","endpointType":"EDGE","resourceMode":0,"resourceName":"signin","resourcePath":"/signin","restMethod":"POST","proxyIntegration":false,"stageMode":0,"stageName":"prod"}]}}},"apigusEast1authApisignuppost":{"name":"apigusEast1authApisignuppost","type":"API_GATEWAY","config":{"selectedRegion":"us-east-1","apiMode":0,"apiName":"auth-api","endpointType":"EDGE","resourceMode":0,"resourceName":"signup","resourcePath":"/signup","restMethod":"POST","proxyIntegration":false,"stageMode":0,"stageName":"prod"},"globallyEditable":true,"usage":{"b25cfaa4-4d44-4464-83f9-5b8ff3d06549":{"operations":{},"occurrence":1,"triggers":[{}]}}}},"packageJSON":{"dependencies":{"aws-sdk":{"name":"aws-sdk","version":"2.176.0","notRemovable":true},"slappforge-sdk":{"name":"@slappforge/slappforge-sdk","version":"0.0.3","notRemovable":true},"SL":"0.0.3"}},"changeExistingProject":false,"additionalFiles":[],"lambdaId":"b25cfaa4-4d44-4464-83f9-5b8ff3d06549"},"PROJECT_META":{"projectName":"simple-authenticator-sigma-sample","projectDescription":"","projectVersion":"1.0.0","projectRegion":"us-east-1","repoName":"simple-authenticator","repoUrl":"https://github.com/Rajind/simple-authenticator","lastSave":1518154053447}}