open-index/open-npm huggingface dataset:
npm package: @softchef/cdk-apigateways
Description: This is a AWS CDK construct package. To mix multiple RestApi/HttpApi endpoints to CloudFront distribution(CDN). Also generate documentation page with your Swagger/OpenAPI definitions.
Author: SoftChef
Latest version: 2.0.5

# AWS CDK with API Gateway(s) & CloudFront(CDN)

[![npm version](https://badge.fury.io/js/%40softchef%2Fcdk-apigateways.svg)](https://badge.fury.io/js/%40softchef%2Fcdk-restapi)
![Release](https://github.com/SoftChef/cdk-apigateways/workflows/Release/badge.svg)
![npm](https://img.shields.io/npm/dt/@softchef/cdk-apigateways?label=NPM%20Downloads&color=orange)

`cdk-apigateways` is an AWS CDK construct. It's help to mix multiple `RestApi` or `HttpApi` (API Gateway) or `RestApi` [(@softchef/cdk-restapi)](https://github.com/SoftChef/cdk-restapi) to the same CloudFront distribution. If you have provide the `Swagger 2.0` / `Open API 3.0` / `Open API 3.1` definitions file, it will generate documentation website in the same distribution.

## Installation

### NPM
```
npm install @softchef/cdk-apigateways
```

### Yarn
```
yarn add @softchef/cdk-apigateways
```

## Example

```
const apis = new ApiGateways(this, 'ApiGateways', {
  stageName: 'prod',
  originApisConfig: {
    books: {
      originApi: booksApi,
    },
    articles: {
      originApi: articlesApi,
    },
  },
  distribution: {
    comment: 'ApiGateways',
  },
  documentation: {
    s3Bucket: docBucket,
    file: './docs/swagger.yaml',
  },
});
```

## Todo List
- Add architecture diagram
- Add about Redoc

## License
This code is licensed under the Apache License 2.0. See the [LICENSE](https://github.com/SoftChef/cdk-apigateways/blob/main/LICENSE) file.
npm package: @softchef/cdk-restapi
Description: Easy to manage Rest-API
Author: SoftChef
Latest version: 2.0.183

# AWS CDK with RestApi

[![npm version](https://badge.fury.io/js/%40softchef%2Fcdk-restapi.svg)](https://badge.fury.io/js/%40softchef%2Fcdk-restapi)
![Release](https://github.com/SoftChef/cdk-restapi/workflows/Release/badge.svg)
![npm](https://img.shields.io/npm/dt/@softchef/cdk-restapi?label=NPM%20Downloads&color=orange)

This construct is base on @aws/aws-apigateway.RestApi.

The RestApi has addResource & addMethod function to create REST API routes. But the source code are low readability about what kind of resources and method in the API. So this construct are redefine the resources to improve readability.

## Installation

```
  npm install @softchef/cdk-restapi
  // or
  yarn add @softchef/cdk-restapi
```

## Example
```
const demoRestApi = new RestApi(stack, 'RestApiDemo', {
  resources: [
    {
      path: '/articles',
      httpMethod: HttpMethod.GET,
      lambdaFunction: new lambda.NodejsFunction(stack, 'GetArticles', {
        entry: `./lambda-assets/articles/get-articles/app.ts`,
      }),
    },
    {
      path: '/articles',
      httpMethod: HttpMethod.POST,
      lambdaFunction: new lambda.NodejsFunction(stack, 'CreateArticle', {
        entry: `./lambda-assets/articles/create-article/app.ts`,
      }),
    },
    {
      path: '/articles/{articleId}',
      httpMethod: HttpMethod.GET,
      lambdaFunction: new lambda.NodejsFunction(stack, 'GetArticle', {
        entry: `./lambda-assets/articles/get-article/app.ts`,
      }),
    },
    {
      path: '/articles/{articleId}',
      httpMethod: HttpMethod.PUT,
      lambdaFunction: new lambda.NodejsFunction(stack, 'UpdateArticle', {
        entry: `./lambda-assets/articles/update-article/app.ts`,
      }),
    },
    {
      path: '/articles/{articleId}/comments',
      httpMethod: HttpMethod.GET,
      lambdaFunction: new lambda.NodejsFunction(stack, 'GetComments', {
        entry: `./lambda-assets/articles/get-comments/app.ts`,
      }),
    },
    {
      path: '/articles/{articleId}/comments',
      httpMethod: HttpMethod.POST,
      lambdaFunction: new lambda.NodejsFunction(stack, 'CreateComment', {
        entry: `./lambda-assets/articles/create-comment/app.ts`,
      }),
    },
  ],
  enableCors: true,
});

// Add multi-resources
demoRestApi.addResources([
  {
    path: '/authors',
    httpMethod: HttpMethod.GET,
    lambdaFunction: new lambda.NodejsFunction(stack, 'GetAuthors', {
      entry: `./lambda-assets/authors/get-authors/app.ts`,
    }),
  },
  {
    path: '/authors/{authorId}',
    httpMethod: HttpMethod.GET,
    lambdaFunction: new lambda.NodejsFunction(stack, 'GetAuthor', {
      entry: `./lambda-assets/authors/get-author/app.ts`,
    }),
  }
]);

// Add single resource
demoRestApi.addResource({
  path: '/authors',
  httpMethod: HttpMethod.POST,
  lambdaFunction: new lambda.NodejsFunction(stack, 'CreateAuthors', {
    entry: `./lambda-assets/authors/create-authors/app.ts`,
  }),
})

```



### Demo

1. Clone this repository
2. Run commands
```
npx projen
cdk deploy --app lib/demo/demo.js
```
3. Checkout the CloudFormation stacks and API Gateway
npm package: @softchef/cdk-schedule-function
Description: Manageable schedule to invoke lambda functions
Author: SoftChef
Latest version: 2.0.94

# CDK Construct - Schedule Function

[![npm version](https://badge.fury.io/js/%40softchef%2Fcdk-schedule-function.svg)](https://badge.fury.io/js/%40softchef%2Fcdk-schedule-function)
![Release](https://github.com/SoftChef/cdk-schedule-function/workflows/Release/badge.svg)
![npm](https://img.shields.io/npm/dt/@softchef/cdk-schedule-function?label=NPM%20Downloads&color=orange)

ScheduleFunction is CDK Construct, provide lambda functions to manage your schedule with Amazon EventBridge service. It is arrange one-time or multi-times schedule to invoke specify lambda functions. It is not permanent recurly, because you can use original EventBridge rule.

You can hook the lambda functions to your API Gateway to manage your schedules. The schedules will store in the DynamoDB table, you can tracking the schedules status, execution results, etc...

![Architecture](docs/schedule-function-architecture.png)

---

## Installation

```
npm install @softchef/cdk-schedule-function

or

yarn add @softchef/cdk-schedule-function
```

## Usage

```
const scheduleFunction = new ScheduleFunction(stack, 'ScheduleFunction', {});

scheduleFunction.addTargetFunction('CreateJob', targetFunction);

```

The Target Function is actual to execute function for business logic. The 'CreateJob' is targetType to identify this function when schedule running.

You can add many targetFunction to process different logic.


## Hook

```
const restApi = new apigateway.RestApi(stack, 'RestApi');

const rootResource = restApi.root.addResource('schedules');

rootResource.addMethod('POST', apigateway.LambdaIntegration(scheduleFunction.createScheduleFunction));  // Create schdules
rootResource.addMethod('GET', apigateway.LambdaIntegration(scheduleFunction.listSchedulesFunction));  // List schdules

const scheduleResource = rootResource.addResource('{scheduleId}');

scheduleResource.addMethod('GET', apigateway.LambdaIntegration(scheduleFunction.fetchScheduleFunction));  // Fetch schdule
scheduleResource.addMethod('PUT', apigateway.LambdaIntegration(scheduleFunction.updateSchedulesFunction));  // Update schdule
scheduleResource.addMethod('PUT', apigateway.LambdaIntegration(scheduleFunction.deleteSchedulesFunction));  // Delete schdule

more...
```

## Example

[Demo stack](./src/demo)

## Roadmap

- DispatchTarget performance up(StepFunction or SQS)
- Export more internal resource
- DynamoDB indexs/capacity best optimization
npm package: @softchef/cdk-vue3
Description: Auto deploy website with VueJs 3 to S3 bucket and CloudFront distribution.
Author: SoftChef
Latest version: 2.0.53

# AWS CDK with VueJs v3

[![npm version](https://badge.fury.io/js/%40softchef%2Fcdk-vue3.svg)](https://badge.fury.io/js/%40softchef%2Fcdk-vue3)
![Release](https://github.com/SoftChef/cdk-vue3/workflows/Release/badge.svg)
![npm](https://img.shields.io/npm/dt/@softchef/cdk-vue3?label=NPM%20Downloads&color=orange)

AWS CDK with VueJs v3 package will auto deploy website with VueJs to S3 bucket and CloudFront distribution.

VueJs will build on local environment or docker container, it's based with Vite project. Then use S3-Deployment to upload to specify S3 bucket.

If you have many resource arguments will pass to frontend, the config property will generate config.js to specify S3 bucket. It's a VueJs extendsion and archive config in Vue.$config operation.

![Architecture](docs/cdk-vue3.png)

## Installation

```
  npm install @softchef/cdk-vue3
  // or
  yarn add @softchef/cdk-vue3
```

## Example
```
import { VueDeployment } from '@softchef/cdk-vue3'
// In your stack
// Basic deployment
const website = new VueDeployment(this, 'WebsiteDeployment', {
  source: `${CLIENTS_PATH}`,
  clientConfig: {
    config: {
      apiId: articleApi.restApiId, // RestApi
      userPoolId: userPool.userPoolId, // UserPool
      foo: {
        bar: {
          value: 123 // Customize config
        }
      }
    }
  }
})
```

## VueJs Example

```
// In public/index.html
<script type="text/javascript" src="/config.js">

// In main.js or app.js
app.use(window.VueDeploymentConfig)

// In *.vue
import { inject } from 'vue'

const $config = inject('$config')
$config.get('foo') // { bar: { value: 123 } }

```
npm package: @softchef/iot-just-in-time-registration
Description: ## Overview
Author: MinChe Tsai
Latest version: 0.0.70

# AWS IoT Just-In-Time-Registration (JavaScript)

## Overview

This document will help your device connect to AWS IoT quickly. Mainly to speed up the process of certificate exchanging complied to AWS IoT authentication.

## Prepare

Environment

- Create "certs" directory in your develop path.

Packages

- AWS IoT SDK for JavaScript https://github.com/aws/aws-iot-device-sdk-js

sensor.live

- Enable SATR on sensor.live, you will get root_ca.cert.pem, ca.cert.pem and ca.private_key.pem.
- Put the pem files into ./certs directory.

## Installation

```
npm install @softchef/iot-just-in-time-registration

or

yarn add @softchef/iot-just-in-time-registration
```
## Examples

[Example code](https://github.com/SoftChefiot-just-in-time-registration-javascript/tree/main/example/)

## API Documentation

#### ThingRegistry.generateDeviceCertificate(thingName, options)

Default options:
```
options = {
    countryName = 'TW',
    stateName = 'Taipei',
    localityName = 'Neihu',
    organizationName = 'SoftChef',
    organizationUnitName = 'IT'
}
```
You can customize the thing name, please ensure the thing name is given uniquely.

The naming rule is based on AWS IoT requirement: Must contain only alphanumeric characters and/or the following: -_:

If your thing_name is null, alternatively, the thing name will generate from the device certificate.

#### ThingRegistry.thingName

Get the thing name. Your customized name or from the device certificate.

#### ThingRegistry.keysPath

Return the keys path, properties follow AWS IoT connection options.

#### ThingRegistry.setCertsPath(path)

Change the default certificate files directory.

#### ThingRegistry.setCACertificateName(name)

Change the default CA certificate file name.

#### ThingRegistry.setCAPrivateKeyName(name)

Change the default CA private key file name.

#### ThingRegistry.setRootCACertificateName(name)

Change the default RootCA certificate file name.

#### ThingRegistry.setDeviceCsrName(name)

Change the default device certificate request file name.

#### ThingRegistry.setDeviceCertificateName(name)

Change the default device certificate file name.

#### ThingRegistry.setDevicePublicKeyName(name)

Change the default device public key file name.

#### ThingRegistry.setDevicePrivateKeyName(name)

Change the default device private key file name.

## License

This SDK is distributed under the GNU GENERAL PUBLIC LICENSE Version 3, see LICENSE for more information.