Skip to content

Commit

Permalink
Merge branch 'main' into tbeseda/tap-arc
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeseda committed Sep 26, 2023
2 parents f2c23f5 + 1b39179 commit d9cdc88
Show file tree
Hide file tree
Showing 23 changed files with 2,872 additions and 97 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
scratch
test/mock/
bench/tmp/
**/_vendor.*js
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Node CI
name: Benchmark

# Push tests pushes; PR tests merges
on: [ push ]
Expand Down
41 changes: 37 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:

# ----- Only git tag testing + package publishing beyond this point ----- #

# Publish to package registries
publish:
# Publish client to package registries
publish-client:
# Setup
needs: build
if: startsWith(github.ref, 'refs/tags/v')
Expand All @@ -84,13 +84,13 @@ jobs:
registry-url: https://registry.npmjs.org/

# Publish to npm
- name: Publish @RC to npm
- name: Publish client@RC to npm
if: contains(github.ref, 'RC')
run: npm publish --tag RC
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish @latest to npm
- name: Publish client@latest to npm
if: contains(github.ref, 'RC') == false #'!contains()'' doesn't work lol
run: npm publish
env:
Expand All @@ -104,3 +104,36 @@ jobs:
title: "npm publish"
color: 0x222222
username: GitHub Actions

# Publish modules to package registries
publish-modules:
# Setup
needs: build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

# Go
steps:
- name: Check out repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
registry-url: https://registry.npmjs.org/

# Publish to npm
- name: Publish plugins@latest to npm
run: npm run publish-plugins
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Notify
uses: sarisia/actions-status-discord@v1
if: always()
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
title: "npm run publish-plugins"
color: 0x222222
username: GitHub Actions
19 changes: 16 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@aws-lite/client",
"version": "0.4.0",
"version": "0.6.1",
"description": "A simple, fast, extensible AWS client",
"homepage": "https://github.com/architect/aws-lite",
"repository": {
Expand All @@ -9,12 +9,16 @@
},
"bugs": "https://github.com/architect/aws-lite/issues",
"scripts": {
"generate": "npm run generate-plugins",
"generate-plugins": "node scripts/generate-plugins",
"publish-plugins": "node scripts/publish-plugins",
"lint": "eslint --fix .",
"test": "npm run lint && npm run coverage",
"test:integration": "cross-env tape 'test/integration/**/*-test.js' | tap-arc",
"test:unit": "cross-env tape 'test/unit/**/*-test.js' | tap-arc",
"test:live": "cross-env tape 'test/live/**/*-test.js' | tap-arc",
"coverage": "nyc --reporter=lcov --reporter=text npm run test:unit"
"coverage": "nyc --reporter=lcov --reporter=text npm run test:unit",
"vendor": "esbuild scripts/vendor-entry.mjs --bundle --platform=node --format=cjs --outfile=src/_vendor.js"
},
"main": "src/index.js",
"engines": {
Expand All @@ -28,6 +32,7 @@
"devDependencies": {
"@architect/eslint-config": "^2.1.1",
"@aws-sdk/client-ssm": "^3.405.0",
"@aws-sdk/util-dynamodb": "^3.415.0",
"adm-zip": "^0.5.10",
"cross-env": "^7.0.3",
"eslint": "^8.48.0",
Expand All @@ -39,6 +44,9 @@
"files": [
"src"
],
"workspaces": [
"plugins/dynamodb"
],
"eslintConfig": {
"extends": "@architect/eslint-config"
},
Expand All @@ -47,6 +55,11 @@
"branches": 100,
"lines": 100,
"functions": 100,
"statements": 100
"statements": 100,
"exclude": [
"plugins/",
"test/",
"src/_vendor.js"
]
}
}
21 changes: 21 additions & 0 deletions plugins/dynamodb/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@aws-lite/dynamodb",
"version": "0.1.1",
"description": "Official `aws-lite` plugin for DynamoDB",
"homepage": "https://github.com/architect/aws-lite",
"repository": {
"type": "git",
"url": "https://github.com/architect/aws-lite",
"directory": "plugins/dynamodb"
},
"bugs": "https://github.com/architect/aws-lite/issues",
"main": "src/index.mjs",
"engines": {
"node": ">=16"
},
"author": "@architect",
"license": "Apache-2.0",
"files": [
"src"
]
}
97 changes: 97 additions & 0 deletions plugins/dynamodb/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# `@aws-lite/dynamodb`

> Official `aws-lite` plugin for DynamoDB
> Maintained by: [@architect](https://github.com/architect)

## Install

```sh
npm i @aws-lite/dynamodb
```


## Usage

This plugin covers all DynamoDB methods (listed & linked below), utilizing DynamoDB's semantics.

By default, with the exception of certain legacy properties (noted below), this plugin will automatically (de)serialize AWS-flavored JSON in requests and responses, so you do not have to treat that as a concern.

> Legacy properties (which DynamoDB discourages the use of) that will not be automatically (de)serialized: `DeleteItem.Expected`, `PutItem.Expected`, `Query.KeyConditions`, `Query.QueryFilter`, `Scan.ScanFilter`, `UpdateItem.Expected`

### Example

```js
import awsLite from '@aws-lite/client'
const aws = await awsLite()

// See: https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html
await aws.dynamodb.PutItem({
TableName: 'your-table-name',
Item: { id: 'hello', ts: new Date().toISOString() }
})
```


### DynamoDB methods

- [`BatchExecuteStatement`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchExecuteStatement.html)
- [`BatchGetItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchGetItem.html)
- [`BatchWriteItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_BatchWriteItem.html)
- [`CreateBackup`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateBackup.html)
- [`CreateGlobalTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateGlobalTable.html)
- [`CreateTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_CreateTable.html)
- [`DeleteBackup`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteBackup.html)
- [`DeleteItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteItem.html)
- [`DeleteTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DeleteTable.html)
- [`DescribeBackup`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeBackup.html)
- [`DescribeContinuousBackups`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeContinuousBackups.html)
- [`DescribeContributorInsights`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeContributorInsights.html)
- [`DescribeEndpoints`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeEndpoints.html)
- [`DescribeExport`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeExport.html)
- [`DescribeGlobalTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeGlobalTable.html)
- [`DescribeGlobalTableSettings`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeGlobalTableSettings.html)
- [`DescribeImport`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeImport.html)
- [`DescribeKinesisStreamingDestination`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeKinesisStreamingDestination.html)
- [`DescribeLimits`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeLimits.html)
- [`DescribeTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html)
- [`DescribeTableReplicaAutoScaling`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTableReplicaAutoScaling.html)
- [`DescribeTimeToLive`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTimeToLive.html)
- [`DisableKinesisStreamingDestination`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DisableKinesisStreamingDestination.html)
- [`EnableKinesisStreamingDestination`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_EnableKinesisStreamingDestination.html)
- [`ExecuteStatement`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExecuteStatement.html)
- [`ExecuteTransaction`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExecuteTransaction.html)
- [`ExportTableToPointInTime`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ExportTableToPointInTime.html)
- [`GetItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_GetItem.html)
- [`ImportTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ImportTable.html)
- [`ListBackups`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListBackups.html)
- [`ListContributorInsights`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListContributorInsights.html)
- [`ListExports`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListExports.html)
- [`ListGlobalTables`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListGlobalTables.html)
- [`ListImports`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListImports.html)
- [`ListTables`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTables.html)
- [`ListTagsOfResource`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_ListTagsOfResource.html)
- [`PutItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html)
- [`Query`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Query.html)
- [`RestoreTableFromBackup`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_RestoreTableFromBackup.html)
- [`RestoreTableToPointInTime`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_RestoreTableToPointInTime.html)
- [`Scan`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_Scan.html)
- [`TagResource`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TagResource.html)
- [`TransactGetItems`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactGetItems.html)
- [`TransactWriteItems`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_TransactWriteItems.html)
- [`UntagResource`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UntagResource.html)
- [`UpdateContinuousBackups`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateContinuousBackups.html)
- [`UpdateContributorInsights`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateContributorInsights.html)
- [`UpdateGlobalTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateGlobalTable.html)
- [`UpdateGlobalTableSettings`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateGlobalTableSettings.html)
- [`UpdateItem`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html)
- [`UpdateTable`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html)
- [`UpdateTableReplicaAutoScaling`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTableReplicaAutoScaling.html)
- [`UpdateTimeToLive`](https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTimeToLive.html)


## Learn more

Please see the [main `aws-lite` readme](https://github.com/architect/aws-lite) for more information about `aws-lite` plugins.
Loading

0 comments on commit d9cdc88

Please sign in to comment.