@politico/hermes

1.3.1 • Public • Published

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
  • Cloudflare (cloudflare)
    • purge
  • DOMO (domo)
    • Auth Functions (client.auth.X)
      • token
    • query
  • 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

Readme

Keywords

none

Package Sidebar

Install

npm i @politico/hermes

Weekly Downloads

29

Version

1.3.1

License

MIT

Unpacked Size

5.7 MB

Total Files

86

Last publish

Collaborators

  • dlazarenko-c-nitka
  • caitlinfloyd
  • tcrite_pol
  • ewalters-politico
  • andmilligan
  • rbvea
  • mshushan-politico
  • kherbert
  • pfriedr
  • arm5077
  • wickidd
  • stilessl
  • guirreri
  • mazet
  • brizandrew
  • bzjin