@atomist/sdm-pack-event-relay
Atomist SDM Pack Event Relay
Last updated 10 months ago by atomist .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @atomist/sdm-pack-event-relay 
SYNC missed versions from official npm registry.

@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:

 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.

Getting started

See the Developer Quick Start to jump straight to creating an SDM.

Contributing

Contributions to this project from community members are encouraged and appreciated. Please review the Contributing Guidelines for more information. Also see the Development section in this document.

Code of conduct

This project is governed by the Code of Conduct. 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 for developer documentation.

Connect

Follow @atomist and The Composition blog related to SDM.

Support

General support questions should be discussed in the #support channel in the Atomist community Slack workspace.

If you find a problem, please create an issue.

Development

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

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. Just press the 'Approve' button in the Atomist dashboard or Slack.


Created by Atomist. Need Help? Join our Slack workspace.

Current Tags

27 Versions

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 254
Last Day 0
Last Week 0
Last Month 287
Dependencies (3)
Dev Dependencies (15)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |