# aws-application-services

> ## Overview

Latest version **1.0.0** (published 2022-05-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install aws-application-services
pnpm add aws-application-services
yarn add aws-application-services
bun add aws-application-services
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2022-05-14 |
| First published | 2022-05-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 13 |
| Unpacked size | 56.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | joaovitor32 |

## Links

- npm: https://www.npmjs.com/package/aws-application-services
- npm.io page: https://npm.io/package/aws-application-services

## Dependencies (13)

- [mime](https://npm.io/package/mime.md) ^3.0.0
- [rollup](https://npm.io/package/rollup.md) ^2.72.1
- [ts-jest](https://npm.io/package/ts-jest.md) ^27.1.4
- [ts-node](https://npm.io/package/ts-node.md) ^10.7.0
- [babel-jest](https://npm.io/package/babel-jest.md) ^28.0.2
- [rollup-plugin-dts](https://npm.io/package/rollup-plugin-dts.md) ^4.2.1
- [@aws-sdk/client-s3](https://npm.io/package/@aws-sdk/client-s3.md) ^3.74.0
- [@aws-sdk/client-sns](https://npm.io/package/@aws-sdk/client-sns.md) ^3.79.0
- [rollup-plugin-terser](https://npm.io/package/rollup-plugin-terser.md) ^7.0.2
- [@rollup/plugin-commonjs](https://npm.io/package/@rollup/plugin-commonjs.md) ^22.0.0
- [@rollup/plugin-typescript](https://npm.io/package/@rollup/plugin-typescript.md) ^8.3.2
- [@rollup/plugin-node-resolve](https://npm.io/package/@rollup/plugin-node-resolve.md) ^13.3.0
- [rollup-plugin-peer-deps-external](https://npm.io/package/rollup-plugin-peer-deps-external.md) ^2.2.4

## Recent versions

- 1.0.0 (latest) — 2022-05-14

## README

# aws-application-services

## Overview

   
#####  
A simple set of functions to facilitate the use of AWS services, such as: S3, SNS...

##### Installation

```bash
npm i aws-application-services
```
### S3 Functions

| Function             | Parameters | Response - Return type |
| -------------------- | -------- | -------- | 
| listFiles                | Bucket: string  | Retrieve files inside specific bucket    
| getFile                | { Bucket: string, Key:string }  | Get specific file inside specific bucket    
| checkIfBucketExists    | bucketName: string  | Returns a boolean related to the existence of a bucket    
| createBucket | { bucketName:string, ACL: string }   | Returns instance of newly created bucket 
| saveFile | {  Bucket:string, file:string, ACL:string } | Returns instance of newly created file  
| deletedFile | {  Bucket:string, Key:string } | Returns instance of newly deleted file  
                                        

### SNS Functions

| Function             | Parameters | Response - Return type |
| -------------------- | -------- | -------- | 
| unsubscribe         |  subscriptionArn: string  | Return object related to subscription delete
| confirmSubscription       |  { TopicArn, Token: string }  | Return object related to confirmation of subscription
| publish       |  { TopicArn: string, Message: string }  | Return object related to message sent to a topic
| deleteTopic       |  name:string  | Return object related to deletion of topic and all subscriptions 
| listTopics       |   | Return object related to all user's topics
| checkAccreditedPhone       |  phoneNumber:string  | Check if phone holder opted to receive messages
| createSubscription       |  { TopicArn: string , Protocol: string, Endpoint: string }  | Subscribe someone to an especific topic
| createTopic       |  name: string  | Return object related to topic creation


### How instantiate aws factory

```ts
import AwsFactory from "aws-application-services";

const { SNS, S3 } = AwsFactory.startAws({
    region: "region",    
    accessKeyId: "accessKeyId",
    secretAccessKey: "secretAccessKey",
    apiVersion: "apiVersion"
});

```

### How use instance

```ts
const createBucket = async ({bucketName,ACL}) =>{
    return S3.createBucket({bucketName,ACL});
};

const listTopics = async  () =>{
    return SNS.listTopics();
};
```

### Tests
#### To run tests you can use the following command:
```
$ npm run test
```

### Reference

##### https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html

## License

[MIT](https://choosealicense.com/licenses/mit/)

---
_Source: https://npm.io/package/aws-application-services · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
