# @dashkite/mercury-sky

> Mercury (HTTP) combinators for use with Sky APIs

Latest version **0.2.0** (published 2021-09-08) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

```sh
npm install @dashkite/mercury-sky
pnpm add @dashkite/mercury-sky
yarn add @dashkite/mercury-sky
bun add @dashkite/mercury-sky
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2021-09-08 |
| First published | 2020-05-17 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 32.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | dyoder, freeformflow |

## Links

- npm: https://www.npmjs.com/package/@dashkite/mercury-sky
- Repository: https://github.com/dashkite/mercury-sky
- Homepage: https://github.com/dashkite/mercury-sky#readme
- Issues: https://github.com/dashkite/mercury-sky/issues
- npm.io page: https://npm.io/package/@dashkite/mercury-sky

## Dependencies (3)

- [@dashkite/joy](https://npm.io/package/@dashkite/joy.md) ^0.3.11
- [@dashkite/katana](https://npm.io/package/@dashkite/katana.md) ^0.4.8
- [@dashkite/mercury](https://npm.io/package/@dashkite/mercury.md) ^0.3.1

## Recent versions

- 0.2.0 (latest) — 2021-09-08
- 0.1.4 — 2021-08-04
- 0.1.3 — 2021-08-02
- 0.1.2 — 2021-08-02
- 0.1.1 — 2021-05-21
- 0.1.0 — 2021-05-21
- 0.0.6 — 2020-10-17
- 0.0.5 — 2020-09-11
- 0.0.4 — 2020-06-13
- 0.0.3 — 2020-05-28
- 0.0.2 — 2020-05-17
- 0.0.1 — 2020-05-17

## README

# Mercury-Sky

Mercury (HTTP) combinators for use with Sky APIs.

```coffeescript
import {property} from "panda-garden"
import {cast} from "@dashkite/katana"
import {use, content, authorize, json} from "@dashkite/mercury"
import Sky from "@dashkite/mercury-sky"

{discover, resource, method, request} = Sky

getPerson = flow [
  use Fetch.client mode: "cors"
  discover "https://api.acme.org"
  resource "people"
  cast query, [ property "data" ]
  method "get"
  request
  json
  property "json"
]

do ->
  alice = await getPerson name: "Alice"
```

This augments the base [Mercury](https://github.com/dashkite/mercury) combinators with Panda Sky aware combinators.

## Install

```
npm i @dashkite/mercury
npm i @dashkite/mercury-sky
```

## API

#### discover url

Make a discovery request against the given URL for the Sky API description. The result is placed into the request context using the `api` property and cached in memory to avoid redundant requests.

#### resource name

Sets the URL template based on the Sky API description.

#### method name

Replaces the Mercury `method` combinator. Checks that the method is supported for the given resource and sets the method and headers, if applicable, based on the given resource and method.

#### request

Replaces the Mercury `request` combinator. Performs the request but validates that the response matches the expected response for the given resource and method.

---
_Source: https://npm.io/package/@dashkite/mercury-sky · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
