@politico/hermes
v2.2.0
Published
*The herald of the POLITICO newsroom*
Downloads
172
Maintainers
Keywords
Readme
Hermes
The herald of the POLITICO newsroom
Why This?
The AWS-SDK has a great set of tools for uploading and removing files form S3. Hermes is an opinionated library built on top of that to make publishing easier for those projects that follow our configurations.
Basic Usage
Install the library
$ npm i @politico/hermes
Import and run in node script in your bin scripts.
/* bin/publish.js */
import * as hermes from '@politico/hermes';
await hermes.publish(
sourceDirectory,
destinationKey,
{ ...options }
)
Run the bin script:
$ node bin/publish.js
Advanced Usage (Clients)
Another major offer of hermes is our clients systems. Hermes offers the following clients:
import * as hermes from '@politico/hermes';
const s3 = await hermes.clients.aws.s3();
await s3.upload({
...options
});
Each client also comes with a .client
property which allows access to the base client instance for custom calls.
Client Offerings
Our client offerings are:
- AWS DynamoDB (
aws.ddb
)- batchGetDocuments
- query
- scan
- Document Functions (
client.document.X
)- delete
- get
- getFromIndex
- put
- update
- AWS S3 (
aws.s3
)- copy
- delete
- download
- etag
- exists
- head
- list
- upload
- AWS Secrets Manager (
aws.secrets
)- getJSONSecret
- AWS Systems Manager (Paramter Store) (
aws.ssm
)- getParameters
- AWS Security Token Serve (
aws.sts
)- assumeConfiguredRole
- getCallerIdentity
- Brightspot (
bsp
)- Embed Functions (
client.embed.X
)- get
- create
- update
- Article Functions (
client.article.X
)- get
- list
- Embed Functions (
- Cloudflare (
cloudflare
)- purge
- DOMO (
domo
)- Auth Functions (
client.auth.X
)- token
- query
- Auth Functions (
- Notion (
notion
)- getPageBlocks
- writeHeadingToPage
- writeToPage
- Slack (
slack
)- only returns base client for now.
Icon in logo courtesy of: Hermés by IconMark from NounProject.com
©2022 POLITICO