# @atomist/sdm-pack-event-relay

> Atomist SDM Pack Event Relay

Latest version **0.0.1-master.20190830205058** (published 2019-08-30) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atomist/sdm-pack-event-relay
pnpm add @atomist/sdm-pack-event-relay
yarn add @atomist/sdm-pack-event-relay
bun add @atomist/sdm-pack-event-relay
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1-master.20190830205058 |
| Published | 2019-08-30 |
| First published | 2019-08-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=8.1.0 |
| Dependencies | 3 |
| Unpacked size | 171.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Atomist |
| Maintainers | atomist |
| Keywords | atomist, automation, pack, sdm |

## Links

- npm: https://www.npmjs.com/package/@atomist/sdm-pack-event-relay
- Repository: https://github.com/atomist/sdm-pack-event-relay
- Homepage: https://github.com/atomist/sdm-pack-event-relay#readme
- Issues: https://github.com/atomist/sdm-pack-event-relay/issues
- npm.io page: https://npm.io/package/@atomist/sdm-pack-event-relay

## Dependencies (3)

- [sinon](https://npm.io/package/sinon.md) ^7.4.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [@types/sinon](https://npm.io/package/@types/sinon.md) ^7.0.13

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.1-master.20190830205058 (latest) — 2019-08-30
- 0.0.1-master.20210108051801 (branch-master) — 2021-01-08
- 0.0.1-master.20200703124747 — 2020-07-03
- 0.0.1-master.20200703124548 — 2020-07-03
- 0.0.1-ipcrm-auth-updates.20200702151348 — 2020-07-02
- 0.0.1-ipcrm-auth-updates.20200630143141 — 2020-06-30
- 0.0.1-ipcrm-auth-updates.20200630142022 — 2020-06-30
- 0.0.1-ipcrm-auth-updates.20200629204310 — 2020-06-29
- 0.0.1-ipcrm-auth-updates.20200629203849 — 2020-06-29
- 0.0.1-master.20200227171849 — 2020-02-27
- 0.0.1-master.20200227163419 — 2020-02-27
- 0.0.1-ipcrm-11.20200227161916 — 2020-02-27
- 0.0.1-ipcrm-11.20200227123742 — 2020-02-27
- 0.0.1-master.20200227123512 — 2020-02-27
- 0.0.1-issue-10.20200227080437 — 2020-02-27
- … 13 more at https://npm.io/package/@atomist/sdm-pack-event-relay/versions

## README

<p align="center">
  <img src="https://images.atomist.com/sdm/SDM-Logo-Dark.png">
</p>

# @atomist/sdm-pack-event-relay

This extension pack allows an SDM to function as an event relay between event sources and Cortex.  Reasons for doing
this include air-gapped services and needing to "scrub" data from outbound payloads.

An example configuration for a relay configuration:

```typescript
 const bitbucketRelay: EventRelayer<BitbucketTestData> = {
     name: "bitbucketRelay",
     test: payload => !!payload.body.actor && !!payload.body.date && !!payload.body.eventKey,
     processor: async payload => {
         (payload.body as any)["x-bitbucket-type"] = payload.headers["x-event-key"];
         return {body: payload.body, headers: payload.headers};
     },
     targetEvent: {
         eventType: "public",
         eventTarget: sdm.configuration.sdm.git.webhookdest,
         headers: (ctx, payload) => {
             payload.headers = addAtomistSignatureHeader(
                 sdm.configuration.sdm.git.key,
                 payload.body,
                 payload.headers as HttpClientOptions["headers"],
             );
             return payload.headers as HttpClientOptions["headers"];
         },
     },
 };

sdm.addExtensionPacks(
    eventRelaySupport({
        eventRelayers: [
            bitbucketRelay,
        ],
    }),
);
``` 

See the `EventRelayer` interface for details on creating EventRelayer(s).  For details on the extension pack
configuration, see the `eventRelaySupport` type documentation.

[atomist-doc]: https://docs.atomist.com/ (Atomist Documentation)

## Getting started

See the [Developer Quick Start][atomist-quick] to jump straight to
creating an SDM.

[atomist-quick]: https://docs.atomist.com/quick-start/ (Atomist - Developer Quick Start)

## Contributing

Contributions to this project from community members are encouraged
and appreciated. Please review the [Contributing
Guidelines](CONTRIBUTING.md) for more information. Also see the
[Development](#development) section in this document.

## Code of conduct

This project is governed by the [Code of
Conduct](CODE_OF_CONDUCT.md). You are expected to act in accordance
with this code by participating. Please report any unacceptable
behavior to code-of-conduct@atomist.com.

## Documentation

Please see [docs.atomist.com][atomist-doc] for
[developer][atomist-doc-sdm] documentation.

[atomist-doc-sdm]: https://docs.atomist.com/developer/sdm/ (Atomist Documentation - SDM Developer)

## Connect

Follow [@atomist][atomist-twitter] and [The Composition][atomist-blog]
blog related to SDM.

[atomist-twitter]: https://twitter.com/atomist (Atomist on Twitter)
[atomist-blog]: https://the-composition.com/ (The Composition - The Official Atomist Blog)

## Support

General support questions should be discussed in the `#support`
channel in the [Atomist community Slack workspace][slack].

If you find a problem, please create an [issue][].

[issue]: https://github.com/atomist-seeds/sdm-pack/issues

## Development

You will need to install [Node.js][node] to build and test this
project.

[node]: https://nodejs.org/ (Node.js)

### Build and test

Install dependencies.

```
$ npm install
```

Use the `build` package script to compile, test, lint, and build the
documentation.

```
$ npm run build
```

### Release

Releases are handled via the [Atomist SDM][atomist-sdm].  Just press
the 'Approve' button in the Atomist dashboard or Slack.

[atomist-sdm]: https://github.com/atomist/atomist-sdm (Atomist Software Delivery Machine)

---

Created by [Atomist][atomist].
Need Help?  [Join our Slack workspace][slack].

[atomist]: https://atomist.com/ (Atomist - How Teams Deliver Software)
[slack]: https://join.atomist.com/ (Atomist Community Slack)

---
_Source: https://npm.io/package/@atomist/sdm-pack-event-relay · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
