Skip to content

Latest commit

 

History

History
129 lines (110 loc) · 2.84 KB

README.md

File metadata and controls

129 lines (110 loc) · 2.84 KB

AWS Services [IN DEVELOPMENT - OPEN FOR CONTRIBUTIONS]

A streamlined process of using all AWS services at one place.

version license status

Requirements

version version

Installation [A STABLE VERSION WILL BE PUBLISHED SOON. TILL THEN YOU CAN IMPORT THE FILES DIRECTLY

npm i aws-services-sdk-wrapper

Import the package

import aws from 'aws-services-sdk-wrapper'

Supported services

Cognito

Create cognito instance

let cognitoObj = new aws.Cognito("AWS_ACCESS_KEY", "AWS_SECRET_KEY", "AWS_REGION", {
  UserPoolId: "USER_POOL_ID",
  ClientId: "USER_POOL_CLIENT_ID",
});

Create user in cognito

cognitoObj.createUser({
    email: STRING|REQUIRED,
    name: STRING|REQUIRED,
    gender: STRING|REQUIRED,
    birthdate: STRING|REQUIRED|YYYY-MM-DD,
    address: STRING|REQUIRED,
    phone_number: STRING|REQUIRED
}).then((response) => {})
.catch((error) => {});

Authenticate user in cognito

cognitoObj.authenticateUser({
    username: STRING|REQUIRED,
    password: STRING|REQUIRED
}).then((response) => {})
.catch((error) => {});

Refresh user token in cognito

cognitoObj.refreshSession({
    username: STRING|REQUIRED,
    refreshToken: STRING|REQUIRED
}).then((response) => {})
.catch((error) => {});

S3

let s3Obj = new aws.S3("AWS_ACCESS_KEY", "AWS_SECRET_KEY", "AWS_REGION");

Create bucket in S3

s3Obj.createBucket({
    bucket: STRING
}).then((response) => {})
.catch((error) => {});

Remove bucket in S3

s3Obj.removeBucket({
    bucket: STRING
}).then((response) => {})
.catch((error) => {});

Upload file in S3

s3Obj.uploadFile({
    bucket: STRING,
    objectKey: STRING,
    objectContent: STRING|BLOB|BINARY
}).then((response) => {})
.catch((error) => {});

Get file from S3

s3Obj.getFile({
    bucket: STRING,
    objectKey: STRING
}).then((response) => {})
.catch((error) => {});

List files from S3

s3Obj.listFiles({
    bucket: STRING
}).then((response) => {})
.catch((error) => {});

Delete file from S3

s3Obj.deleteFile({
    bucket: STRING,
    objectKey: STRING
}).then((response) => {})
.catch((error) => {});

Build using

Dependencies/References

😎 ✌️