open-index/open-npm huggingface dataset:
npm package: @sls-next/aws-sqs
Description: Deploy SQS queues to AWS in seconds with [Serverless Components](https://github.com/serverless/components).
Author: Daniel Conde Marin
Latest version: 3.7.0

# aws-sqs

Deploy SQS queues to AWS in seconds with [Serverless Components](https://github.com/serverless/components).

&nbsp;

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)

&nbsp;

### 1. Install

```console
$ npm install -g serverless
```

### 2. Create

```console
$ mkdir my-function && cd my-function
```

the directory should look something like this:

```
|- code
  |- handler.js
  |- package.json # optional
|- serverless.yml
|- .env           # your AWS api keys
```

```
# .env
AWS_ACCESS_KEY_ID=XXX
AWS_SECRET_ACCESS_KEY=XXX
```

### 3. Configure

```yml
# serverless.yml

myQueue:
  component: "@serverless/aws-sqs"
```

### 4. Deploy

```console
$ serverless
```

### Credits

This package was originally implemented by [DaySmart](https://github.com/DaySmart/aws-sqs).
I decided to fork it and bring it into this monorepo because it wasn't being maintained anymore
npm package: @sls-next/domain
Description: Easily provision custom domains for:
Author: Daniel Conde Marin
Latest version: 3.7.0

# Domain

Easily provision custom domains for:

- Static websites hosted on AWS CloudFront & AWS S3 via the Website Component.
- APIs built via the Backend Component.

### Inputs

```yaml
domain:
  component: "@serverless/domain"
  inputs:
    privateZone: false
    domain: mywebsite.com
    subdomains:
      www: ${websiteComponentInstance}
      api: ${backendComponentInstance}
      admin: ${anotherWebsiteComponentInstance}
    domainMinimumProtocolVersion: "TLSv1.2_2018"
```

### Set-Up

First, you must purchase your domain within Route53 manually. Then add it to the Component, as demonstrated above.

### Using With The Website Component

When used with the Website Component, the domain component will...

- Create an AWS ACM Certificate, if one does not already exists for the domain.
- Create an AWS Cloudfront Distribution that uses the AWS ACM Certificate.
- Create Records in AWS Route 53 to point your custom domain to your AWS Cloudfront Distribution.

### Credits

This package was originally implemented by the [serverless framework team](https://github.com/serverless-components/domain).
I decided to fork it and bring it into this monorepo because it wasn't being maintained anymore
npm package: @sls-next/next-aws-cloudfront
Description: Compat layer for running next.js apps in Lambda@Edge
Author: Daniel Conde
Latest version: 3.7.0

# Next AWS CloudFront

Compat layer between next.js serverless page and CloudFront => Lambda@Edge.

Lambda@Edge event structure documentation can be found [here](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html).

## Installation

`npm install next-aws-cloudfront`

## Usage

```js
const cloudFrontCompat = require("next-aws-cloudfront");
const page = require(".next/serverless/pages/somePage.js");

module.exports.render = async (event, context) => {
  const { req, res, responsePromise } = cloudFrontCompat(event.Records[0].cf);
  page.render(req, res);
  return responsePromise;
};
```

## Options

### Gzip compression

```js
const { req, res, responsePromise } = cloudFrontCompat(event.Records[0].cf, {
  enableHTTPCompression: true // false by default
});
```
npm package: @sls-next/next-aws-lambda
Description: Compat layer between next.js serverless page and AWS Lambda
Author: Daniel Conde Marin
Latest version: 3.5.0

# API Gateway Lambda Compat

Compat layer between next.js serverless page and API Gateway => Lambda Proxy Integration.

Lambda Proxy Integration event structure documentation can be found [here](https://docs.aws.amazon.com/apigateway/latest/developerguide/set-up-lambda-proxy-integrations.html).

## Installation

`npm install @sls-next/next-aws-lambda`

## Usage

```js
const compat = require("@sls-next/next-aws-lambda");
const page = require(".next/serverless/pages/somePage.js");

// using callback

module.exports.render = (event, context, callback) => {
  compat(page)(event, context, callback);
};

// using async promise

module.exports.render = async (event, context) => {
  const responsePromise = compat(page)(event, context); // don't pass the callback parameter
  return responsePromise;
};
```
npm package: @sls-testing/core
Description: Typed, composable testing utilities for AWS Lambda — event builders, context mock, response asserters
Latest version: 1.0.1

# @sls-testing/core

Typed event builders, Lambda context mock, and response asserters for testing AWS Lambda functions.

Framework-agnostic. Works with Jest, Vitest, or any test runner.

## Install

```bash
npm install @sls-testing/core --save-dev
```

Requires `@types/aws-lambda` as a peer dependency:

```bash
npm install @types/aws-lambda --save-dev
```

## Event Builders

Every builder returns a fully-typed event with sensible defaults. Pass a partial override to customize any field.

### API Gateway

```typescript
import { buildApiGatewayEvent, buildApiGatewayV1Event } from '@sls-testing/core'

// HTTP API (v2) — default
const event = buildApiGatewayEvent({
  requestContext: { http: { method: 'POST' } },
  rawPath: '/users',
  body: JSON.stringify({ name: 'Lucas' }),
})

// REST API (v1)
const v1Event = buildApiGatewayV1Event({
  httpMethod: 'GET',
  path: '/users',
  pathParameters: { id: '42' },
})
```

### SQS

```typescript
import { buildSQSEvent } from '@sls-testing/core'

const event = buildSQSEvent({
  records: [
    { body: { orderId: 'abc-123', amount: 99.9 } },
    { body: { orderId: 'def-456', amount: 49.9 } },
  ],
})
// Bodies are auto-serialized to JSON strings
// Each record gets a unique messageId
```

### S3

```typescript
import { buildS3Event } from '@sls-testing/core'

const event = buildS3Event({
  bucket: 'my-bucket',
  key: 'uploads/image.png',
  eventName: 'ObjectCreated:Put', // default
})
```

### EventBridge

```typescript
import { buildEventBridgeEvent } from '@sls-testing/core'

const event = buildEventBridgeEvent({
  source: 'app.orders',
  'detail-type': 'OrderPlaced',
  detail: { orderId: 'abc-123' },
})
```

### SNS

```typescript
import { buildSNSEvent } from '@sls-testing/core'

const event = buildSNSEvent({
  records: [{ message: { action: 'notify' }, topicArn: 'arn:aws:sns:...' }],
})
```

### DynamoDB Streams

```typescript
import { buildDynamoDBStreamEvent } from '@sls-testing/core'

const event = buildDynamoDBStreamEvent({
  records: [{
    eventName: 'INSERT',
    keys: { id: 'abc' },
    newImage: { id: 'abc', name: 'Lucas', count: 42 },
  }],
})
// Values are auto-marshalled to DynamoDB AttributeValue format
```

## Lambda Context Mock

```typescript
import { buildLambdaContext } from '@sls-testing/core'

const context = buildLambdaContext({
  functionName: 'my-service-dev-processOrder',
  memoryLimitInMB: '512',
  remainingTimeOverride: 3000, // ms
})

context.getRemainingTimeInMillis() // 3000
```

## Response Asserters

Framework-agnostic assertion functions that throw on mismatch.

```typescript
import { assertApiResponse, assertSQSBatchResponse } from '@sls-testing/core'

assertApiResponse(response, {
  statusCode: 201,
  bodyContains: { userId: '123' },
  headers: { 'content-type': 'application/json' },
})

assertSQSBatchResponse(response, {
  failedMessageIds: ['msg-2'],
})
```

## License

MIT
npm package: @sls-testing/jest
Description: Jest custom matchers for AWS Lambda testing — extends expect with serverless-specific assertions
Latest version: 1.0.1

# @sls-testing/jest

Custom Jest matchers for testing AWS Lambda functions.

## Install

```bash
npm install @sls-testing/core @sls-testing/jest --save-dev
```

## Setup

Add to your Jest config:

```json
{
  "setupFilesAfterEnv": ["@sls-testing/jest"]
}
```

Or import in your test file:

```typescript
import '@sls-testing/jest'
```

## Matchers

### Status Code

```typescript
expect(response).toHaveStatusCode(200)
expect(response).toBeSuccessfulApiResponse() // 2xx
expect(response).toBeClientError()           // 4xx
expect(response).toBeServerError()           // 5xx
```

### Lambda Response

```typescript
expect(response).toMatchLambdaResponse({
  statusCode: 201,
  body: { userId: expect.any(String) }, // asymmetric matchers work
  headers: { 'content-type': 'application/json' },
})
```

### SQS Batch

```typescript
expect(sqsResponse).toHaveNoFailedMessages()
expect(sqsResponse).toHaveFailedMessage('msg-id-2')
```

### Side Effects

```typescript
const spy = jest.spyOn(service, 'sendEmail')
await handler(event, context)
expect(spy).toHaveNoSideEffects()
```

## Setup Helper

```typescript
import { setupServerlessTesting } from '@sls-testing/jest'

const cleanup = setupServerlessTesting({
  timezone: 'UTC',
  suppressLogs: true,
})

afterAll(() => cleanup())
```

## License

MIT
npm package: @slsplus/core
Description: Serverless Plus Components
Author: Serverless Plus
Latest version: 1.1.8

## Serverless Plus Components Core

Thanks to [serverless/components](https://github.com/serverless/components).

Build, compose, & deploy serverless apps in seconds with **Serverless Components**, the **[Serverless Framework's](https://github.com/serverless-plus/serverless)** new infrastructure provisioning technology.

- - [x] **Speed -** The fastest way to deploy serverless infra and apps.
- - [x] **Power -** Deploy low-level infra, or higher-order use-case abstractions.
- - [x] **Re-Use -** Everything you build is reusable by you, your team, and (if you want) the world.
- - [x] **Composition -** Easily compose Components together in YAML or Javascript.

Here's how easy it is to use Components with Serverless Framework:

```yaml
# serverless.yml
name: website

website:
  component: '@serverless/tencent-website'
  inputs:
    code:
      src: ./src
      hook: npm run build
```

## Quick-Start

Install the [Serverless Plus](https://www.github.com/serverless-plus/serverless) via NPM:

```console
$ npm i -g slsplus
```

#### [部署 Serverless 全栈 WEB 应用（React.js）](https://github.com/serverless/components/tree/master/templates/tencent-fullstack-react-application)

本示例以 React 为前端，Express 框架作为后端，通过多个 Serverless Components 部署 Serverless 全栈应用程序。

```shell
$ slsplus create --template-url https://github.com/serverless-plus/components/tree/master/templates/tencent-fullstack-react-application
```

## Reusability

While Serverless Components can be easily composed in YAML (`serverless.yml`), they are written as reusable javascript libraries (`serverless.js`), with simple syntax inspired by component-based frameworks, like React.

```javascript
// serverless.js

const { Component } = require('@serverless/core')

class MyBlog extends Component {
  async default(inputs) {
    this.context.status('Deploying a serverless blog')
    const website = await this.load('@serverless/tencent-website') // Load a component
    const outputs = await website({ code: { src: './blog-code' } }) // Deploy it
    this.state.url = outputs.url
    await this.save()
    return outputs
  }
}

module.exports = MyBlog
```

Anyone can build a Serverless Component and share it in our upcoming Registry.

## Resources

[awesome-serverless-framework](https://github.com/yugasun/awesome-serverless-framework)
npm package: @slsplus/database
Description: Serverless Database Tool
Author: yugasun
Latest version: 0.0.5

# Serverless Database Tool

[![npm](https://img.shields.io/npm/v/@slsplus/database)](http://www.npmtrends.com/@slsplus/database)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/database.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/database)
[![Status](https://github.com/serverless-plus/database/workflows/Test/badge.svg)](https://github.com/serverless-plus/database/actions?query=workflow:Test)

Serverless database tool.

## Feature

- [x] **Reconnect**, it can reconnect automatically after the connection fails
- [x] **Clear Zoombie Connections**, it can auto clear the zoombie connections
- [x] **Transaction Rollback**, support customize rollback for transaction

## Support

Support database dirver:

- [x] MySQL
- [ ] PostgreSQL

## Usage

```bash
$ npm i @slsplus/database --save
```

### Use with Mysql

Before you use mysql, you should insall `mysql2` dependency:

```bash
$ npm i mysql2 --save
```

Then you can use it as below:

```js
import { Mysql } from '@slsplus/database';

async function example() {
  const db = new Mysql.Database(
    {
      host: 'localhost',
      port: 3306,
      user: 'root',
      password: 'root',
      multipleStatements: true,
    },
    {
      debug: true,
    },
  );

  // insert
  await db.query({
    sql: `
      INSERT INTO users SET ?
    `,
    values: {
      name: 'test',
      email: 'test@test.com',
      site: 'test.com',
    },
  });
  /**
   * return {"fieldCount":0,"affectedRows":1,"insertId":1,"info":"","serverStatus":3,"warningStatus":0}
   */

  // close current connection
  await db.end();
}
```

## Examples

[examples](./examples)

## License

MIT License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/dotenv
Description: Serverless Dotenv Component
Author: Serverless Plus
Latest version: 0.1.2

# Serverless Dotenv Component

[![npm](https://img.shields.io/npm/v/%40slsplus%2Fdotenv)](http://www.npmtrends.com/%40slsplus%2Fdotenv)
[![NPM downloads](http://img.shields.io/npm/dm/%40slsplus%2Fdotenv.svg?style=flat-square)](http://www.npmtrends.com/%40slsplus%2Fdotenv)

## Introduction

Inspired by [serverless-dotenv-plugin](https://github.com/colynb/serverless-dotenv-plugin).

Preload environment variables into serverless. If you have variables stored in a .env file that you want loaded into your serverless yaml config. This will allow you to reference them as \${Dotenv.env.VAR_NAME} inside your config(If you ).

## Setup

Add `@slsplus/dotenv` in your `serverless.yml`, as below:

```yml
Dotenv:
  component: '@slsplus/dotenv'
```

Now create `.env` file in the project root:

```yml
TENCENT_SECRET_ID=xxx
TENCENT_SECRET_KEY=xxx

ABC=124
```

## Automatic Env file name resolution

By default, the component looks for the file: .env. If you want different env files based on environment. For example:

```
.env.development
.env.production
```

Then you can exec deploy command like:

```bash
$ NODE_ENV=development serverless --debug
```

Or, like this:

```bash
$ serverless --debug --env development
```

## Inject custom arguments to command

You can directly run deploy command with custom arguments:

```bash
$ serverless --debug --custom abc --custom1 123
```

Then you can use by `process.env.custom` and `process.env.custom1`

## Options

#### Complete configuration in `serverless.yml`

```yml
# serverless.yml

Dotenv:
  component: '@serverless/dotenv-component'
  inputs:
    envFile: /path/to/my/.env
    envPath: /path/to/my/
    exclude:
      - SECRET
```

#### Configuration description

| Param   | Required/Optional | Type   | Default         | Description                                     |
| ------- | ----------------- | ------ | --------------- | ----------------------------------------------- |
| envFile | Optional          | String | .env            | Dotenv file                                     |
| envPath | Optional          | String | `process.cwd()` | Dotenv file path                                |
| exclude | Optional          | string | []              | Variable in .env file, you don't want to expose |

## More Components

[awesome-serverless-framework](https://github.com/yugasun/awesome-serverless-framework)

## License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/migrate
Description: Serverless Plus Migrate Tool
Author: yugasun
Latest version: 0.0.1-beta-7

# Serverless Plus Migrate Tool

[![npm](https://img.shields.io/npm/v/@slsplus/migrate)](http://www.npmtrends.com/@slsplus/migrate)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/migrate.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/migrate)
[![Status](https://github.com/serverless-plus/migrate/workflows/Test/badge.svg?branch=master)](https://github.com/serverless-plus/migrate/actions?query=workflow:Test+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Serverless Plus Migrate Tool

## Usage

```bash
$ npm i @slsplus/migrate --save
```

```js
import { migrateFramework } from '@slsplus/migrate';

const inputs = migrateFramework(frameworkInputs);
```

## License

MIT License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/node-prune
Description: Node prune tool, prune unnecessary files from ./node_modules, such as markdown, typescript source files, and so on
Author: yugasun
Latest version: 0.0.3

# @slsplus/node-prune

[![npm](https://img.shields.io/npm/v/@slsplus/node-prune)](http://www.npmtrends.com/@slsplus/node-prune)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/node-prune.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/node-prune)
[![Build Status](https://github.com/serverless-plus/node-prune/workflows/Release/badge.svg?branch=master)](https://github.com/serverless-plus/node-prune/actions?query=workflow:Release+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Node prune tool, prune unnecessary files from ./node_modules, such as markdown, typescript source files, and so on. **Inspired by golan version [node-prune](https://github.com/tj/node-prune)**.

## Installation

```bash
$ npm i @slsplus/node-prune -g
```

## Usage

```bash
$ np -h
Usage: np [options]

Prune command for project

Options:
  -v, --version           output the current version
  -e --exclude <exclude>  Glob of files that should not be pruned. Multiple exclude use , to separate.
  -i --include <include>  Globs of files that should always be pruned in addition to the defaults. Multiple include use , to separate.
  -h, --help              display help for command

Example call:
  $ np --help
```

Start to prune:

```bash
$ np
```

## License

MIT License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/python-requirements
Description: Serverless Python Requirements Component
Author: yugasun
Latest version: 0.1.3

# python-requirements

[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/python-requirements.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/python-requirements)

> Notice: This project is a rewrite from [serverless-python-requirements](https://github.com/UnitedIncome/serverless-python-requirements) which is a serverless plugin.

Serverless Python Requirements Component

## Content

1. [Install](#1-install)
2. [Create](#2-create)
3. [Configure](#3-configure)
4. [Deploy](#4-deploy)
5. [Remove](#5-Remove)

### 1. Install

Install the Serverless Framework globally:

```shell
$ npm install -g serverless
```

### 2. Create

Just create the following simple boilerplate:

```shell
$ touch serverless.yml
```

### 3. Configure

```yml
# serverless.yml

MyComponent:
  component: '@slsplus/python-requirements'
  inputs:
    codeUri: ./
    include:
      - handler.py
    dockerizePip: true
    zip: true
```

- [More Options](./docs/configure.md)

### 4. Deploy

```shell
$ sls --debug
```

&nbsp;

### 5. Remove

```shell
$ sls remove --debug
```

### More Components

Checkout the [Serverless Components](https://github.com/serverless/components) repo for more information.
npm package: @slsplus/serverless-http
Description: Serverless HTTP Proxy
Author: yugasun
Latest version: 0.2.2

# Serverless HTTP Proxy

[![npm](https://img.shields.io/npm/v/@slsplus/serverless-http)](http://www.npmtrends.com/@slsplus/serverless-http)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/serverless-http.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/serverless-http)
[![Status](https://github.com/serverless-plus/serverless-http/workflows/Test/badge.svg?branch=master)](https://github.com/serverless-plus/serverless-http/actions?query=workflow:Test+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Serverless HTTP Proxy.

## Installation

```bash
$ npm i @slsplus/serverless-http --save
```

## Usage

### Start proxy by UDS(UNIX Domain Socket)

```js
import http from 'http';
import express from 'express';
import { ServerlessProxy } from '@slsplus/serverless-http';

const app = express();

app.get('/', (req, res) => {
  res.send('Hello Serverless Express');
});

const proxy = new ServerlessProxy({
  requestListener: app,
});

// export serverless handler function
export.handler = async (event, context) => {
  await proxy.start()
  const res = await proxy.getResponse(event);
  return res;
}
```

Here is the example [nodejs-runtime](./examples/nodejs-runtime).

### Start proxy by child process

Start proxy server by child proces, set `useChildProcess` to `true`, like below:

```js
import http from 'http';
import express from 'express';
import { ServerlessProxy } from '@slsplus/serverless-http';

const app = express();

app.get('/', (req, res) => {
  res.send('Hello Serverless Express');
});

const proxy = new ServerlessProxy({
  requestListener: app,
  useChildProcess: true,
});

// export serverless handler function
export.handler = async (event, context) => {
  await proxy.start()
  const res = await proxy.getResponse(event);
  return res;
}
```

### Using with Custom Runtime for Tencent Cloud SCF

```js
import { ServerlessProxy, TencentRuntime } from '@slsplus/serverless-http';
import app from './app';

async function start() {
  const proxy = new ServerlessProxy({
    requestListener: app,
  });
  const runtime = new TencentRuntime({
    proxy,
  });

  // start http server
  await proxy.start();

  // post ready -- finish initialization
  await runtime.ready();
  console.log(`Initialize success`);

  try {
    while (true) {
      await runtime.run();
    }
  } catch (e) {
    await runtime.error({
      statusCode: 501,
      body: `Code Error: ${e}`,
      headers: {},
      isBase64Encoded: false,
    });
  }
}

start();
```

Here is the example [custom-runtime](./examples/custom-runtime).

More information about [Tencent Cloud Custom Runtime](https://cloud.tencent.com/document/product/583/47274).

## License

MIT License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/serverless-updater
Description: Serverless Components Dependencies Updater
Author: yugasun
Latest version: 1.0.4

# Serverless Component Updater

[![npm](https://img.shields.io/npm/v/@slsplus/serverless-updater)](http://www.npmtrends.com/@slsplus/serverless-updater)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/serverless-updater.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/serverless-updater)
[![Build Status](https://github.com/serverless-plus/serverless-updater/workflows/Publish/badge.svg?branch=master)](https://github.com/serverless-plus/serverless-updater/actions?query=workflow:Publish+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Serverless Components Dependencies Updater

## Installation

```bash
$ npm install @slsplus/serverless-updater --g
```

## Usage

This will auto update dependencies in serverless component `src` directory, then commit to github and publish to registry.

```bash
$ slsup --auto-push --auto-publish
```

## Options

```
Options:
  -v, --version                     output the current version
  -c, --component <component name>  component name, multi component use `,` to connect
  -p, --path <path>                 path to component or parent directory for multi updating
  -s, --source <source>             source code directory name (default: "src")
  -m, --multi                       whether update multi components (default: false)
  -aps, --auto-push                 whether auto push to github (default: false)
  -apb, --auto-publish              whether auto publish component (default: false)
  -fpb, --force-publish             whether force to publish component (default: false)
  -h, --help                        display help for command
```

## Development

All `git commit` mesage must follow below syntax:

```bash
type(scope?): subject  #scope is optional
```

support type：

- **feat**: add new feature
- **fix**: fix bug or patch feature
- **ci**: CI
- **chore**: modify config, nothing to do with production code
- **docs**: create or modifiy documents
- **refactor**: refactor project
- **revert**: revert
- **test**: test

Most of time, we just use `feat` and `fix`.

## License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/static
Description: Serverless Static CLI for Cloud Storage
Author: yugasun
Latest version: 0.0.1-beta.0

# Serverless Static CLI

[![npm](https://img.shields.io/npm/v/@slsplus/static)](http://www.npmtrends.com/@slsplus/static)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/static.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/static)

<!-- [![Build Status](https://github.com/serverless-plus/cli/workflows/Release/badge.svg?branch=master)](https://github.com/serverless-plus/cli/actions?query=workflow:Release+branch:master) -->
<!-- [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) -->

Static website CLI for cloud storage.

- [Installation](#installation)
- [Usage](#usage)
  - [Initialize](#initialize)
  - [Deploy](#deploy)
  - [Remove](#remove)

## Support provider

- [x] [Tencent Cloud COS](https://cloud.tencent.com/product/cos)
- [ ] [Aliyun OSS](https://www.aliyun.com/product/oss)
- [ ] [AWS S3](https://aws.amazon.com/s3/)

## Installation

```bash
$ npm i @slsplus/static -g
```

## Usage

```bash
Usage: static [options] [command]

Options:
  -v, --version              output the current version
  -p, --provider [provider]  cloud provider (default: "tencent")
  -h, --help                 display help for command

Commands:
  deploy [options] [source]  Deploy project to cloud storage
  init                       Initialize command for slsplus cli
  help [command]             display help for command

Example call:
  $ static --help
```

### Initailize

```bash
$ yarn static init
yarn run v1.22.10
$ ts-node ./src init
? Please select provider to config tencent
? ID ************************************
? KEY ********************************
✔ Initialize credentials success.
✨  Done in 33.32s.
```

### Deloy

Help:

```bash
Usage: static deploy [options] [source]

Deploy project to cloud storage

Arguments:
  source                 source directory to deploy (default: "process.cwd()")

Options:
  -b, --bucket <bucket>    cloud storage bucket name
  -r, --region [region]    cloud storage bucket region
  -t, --type [type]        storage engine type (default: "cos")
  -m, --mode [mode]        deploy mode (default: "normal")
  -i, --index [index]      index filename (default: "index.html")
  -e, --error [error]      error filename (default: "error.html")
  --prefix [prefix]        cloud storage folder prefix (default: "")
  --https                  force https (default: true)
  --disable-error          disable error code (default: false)
  --ignore-html-ext        ignore html extension (default: false)
  --disable-public-access  disable public access for bucket (default: false)
  -h, --help               display help for command
✨  Done in 3.42s.
```

It will deploy target static foler to cloud storage, use `process.cwd()` by default.

```bash
$ st deploy ./public --bucket=test-123456789
```

### Remove

TODO

## License

MIT License

Copyright (c) 2021 Serverless Plus.
npm package: @slsplus/ui
Description: UI Tool for Serverless Plus CLI
Author: yugasun
Latest version: 0.0.1-beta-6

# Serverless Plus UI

[![npm](https://img.shields.io/npm/v/@slsplus/ui)](http://www.npmtrends.com/@slsplus/ui)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/ui.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/ui)
[![Build Status](https://github.com/serverless-plus/ui/workflows/Validate/badge.svg?branch=master)](https://github.com/serverless-plus/ui/actions?query=workflow:Validate+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Serverless Plus UI Tool

## Usage

```bash
$ npm i @slsplus/ui --save
```

```js
import { startServer } from '@slsplus/ui';

startServer();
```

## Async parameter config

Sometimes, we should get parameters(eg: vpc list) list by api, but they are developer's cloud resources, so if you want to config these parameters, `@slsplus/ui` server need authentication. So please config `TENCENT_SECRET_ID` and `TENCENT_SECRET_KEY` in global environment variables.

Of course, if you are using [@slsplus/cli](https://github.com/serverless-plus/cli), you can run `sp config` command to config it.

```bash
$ sp config
? SecretId ******
? SecretKey ******
```

## Development

Install dependencies:

```bash
$ npm run bootstrap
```

Run server and client:

```bash
$ npm run dev
```

## License

MIT License

Copyright (c) 2020 Serverless Plus
npm package: @slsplus/warmer
Description: Serverless application warmer
Author: yugasun
Latest version: 0.1.1

# Serverless Warmer

[![npm](https://img.shields.io/npm/v/@slsplus/warmer)](http://www.npmtrends.com/@slsplus/warmer)
[![NPM downloads](https://img.shields.io/npm/dm/@slsplus/warmer.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/warmer)
[![Build Status](https://github.com/serverless-tencent/serverless-warmer/workflows/Release/badge.svg?branch=master)](https://github.com/serverless-tencent/serverless-warmer/actions?query=workflow:Release+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Application Warmer for Serverless Framework.

- [@slsplus/warmer](#Serverless-Warmer)
  - [Installation](#installation)
  - [Usage](#usage)
    - [Warm up serverless application](#Warm-up-serverless-application)
    - [Warm up serverless cloud function](#Warm-up-serverless-cloud-function)

## Installation

```bash
$ npm i @slsplus/warmer -g
```

## Usage

```bash
Usage: ywarm [options]

Warm up serverless application with customize variables

Options:
  -v, --version                       output the current version
  -n, --name [name]                   instance name, name config in serverless.yml
  -a, --app [app]                     app name, app config in serverless.yml
  -r, --region [region]               region of function (default: 'ap-guangzhou')
  -s, --stage [stage]                 app stage, stage config in serverless.yml (default: 'dev')
  -o, --org [org]                     app org name, org config in serverless.yml
  -f, --function-name [functionName]  cloud function name
  -h, --help                          display help for command

Example call:
  $ ywarm --help
```

### Warm up serverless application

```bash
$ ywarm --name=expressdemo --app=appname --stage=dev --org=myorg
```

### Warm up serverless cloud function

```bash
$ ywarm -f 'express_jyovx1a'
```

## License

MIT License

Copyright (c) 2021 Tencent Cloud, Inc.
npm package: @slsplus/yaml-parser
Description: Yaml Parser for serverless.yml
Author: yugasun
Latest version: 0.1.2

# Serverless Yaml Parser

[![npm](https://img.shields.io/npm/v/@slsplus/yaml-parser)](http://www.npmtrends.com/@slsplus/yaml-parser)
[![NPM downloads](http://img.shields.io/npm/dm/@slsplus/yaml-parser.svg?style=flat-square)](http://www.npmtrends.com/@slsplus/yaml-parser)
[![Build Status](https://github.com/serverless-plus/cli/workflows/Release/badge.svg?branch=master)](https://github.com/serverless-plus/cli/actions?query=workflow:Release+branch:master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

Yaml Parser for Serverless Framework.

- [@slsplus/yaml-parser](#Serverless-Yaml-Parser)
  - [Installation](#installation)
  - [Usage](#usage)
    - [Parse serverless config file](#Parse-serverless-config-file)

## Installation

```bash
$ npm i @slsplus/yaml-parser -g
```

## Usage

```bash
Usage: yparse [options]

Parse serverless config file with costomize and environment variables replacement

Options:
  -v, --version                       output the current version
  -i, --input [input]                 source serverless config file path
  -o, --output                        whether output parse result to input serverless config file (default: false)
  -O, --output-path [outputPath]      output parse result to target serverless config file path
  -r, --root [rootDir]                root directory for parse command running
  -a, --auto-create                   whether auto create serverless config file (default: false)
  -c, --component [component]         serverless component name
  -s, --sls-options [slsOptions]      serverless config
  -l, --layer-options [layerOptions]  serverless layer config
  -or, --override [override]          override serverless config (default: false)
  -h, --help                          display help for command

Example call:
  $ yparse --help
```

### Parse serverless config file

```bash
$ yparse -o -s '{"src":"./"}'
```

Parse command will parse serverless config file with costomize and environment variables replacement.

For example, before is:

```yaml
inputs:
  region: ${env:REGION}
```

If `process.env.REGION=ap-guangzhou`, after parsing, the `serverless.yml` will be:

```yaml
inputs:
  src: ./
  region: ap-guangzhou
```

## License

MIT License

Copyright (c) 2021 Tencent Cloud, Inc.
npm package: @slub/json-schema-to-graphql
Description: create graphql queries and mutations based on a given JSON-Schema
Author: Sebastian Tilsch
Latest version: 0.1.4

<h1 align="center">json-schema-to-graphql</h1>
<p>
  <img alt="Version" src="https://img.shields.io/badge/version-0.1.0-blue.svg?cacheSeconds=2592000" />
  <img src="https://img.shields.io/badge/node-%3E%3D10-blue.svg" />
  <a href="#" target="_blank">
    <img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg" />
  </a>
</p>

create graphql queries and mutations based on a given JSON-Schema

## Prerequisites

- node >=10

## Install

```sh
yarn add @slub/json-schema-to-graphql
```

## Usage

given the following json schema

```json
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://example.com/person.schema.json",
  "$defs": {
    "person": {
      "type": "object",
      "title": "Person",
      "description": "A human being",
      "required": [
        "name",
        "knows"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "knows": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/person"
          }
        }
      }
    }
  },
  "type": "object",
  "title": "Person",
  "description": "A human being",
  "required": [
    "name",
    "knows"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "knows": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/person"
      }
    }
  }
}
```

you can create a graphql query and mutation like this

```js
jsonSchemaToGraphQLQuery('Person', schema, { maxRecursion: 3 })
```

to get the following query

```graphql
query getPerson( $pk: ID! ) {
    getPerson(pk: $pk) {
        name
        knows {
            name
            knows {
                name
                knows {
                    name
                    id
                }
                id
            }
            id
        }
        id
    }
}
```

## Run tests

```sh
npm run test
```

## Author

👤 **Sebastian Tilsch**

* Github: [@bastiion](https://github.com/bastiion)

## Show your support

Give a ⭐️ if this project helped you!

***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_