open-index/open-npm huggingface dataset:
npm package: @outerbounds/events
Description: Outerbounds Events Publisher
Author: Outerbounds
Latest version: 0.1.4

# Typescript package to publish Events to Outerbounds platform

## Installation

`npm -i @outerbounds/events`

## Usage example

Assuming you have a Flow that is triggerd on event like this

```python
from metaflow import FlowSpec, step, current, trigger


@trigger(event='my_event')
class NodeSimpleTriggeredFlow(FlowSpec):
    @step
    def start(self):
        self.var_1 = ["h", "e", "l", "l"]

        self.next(self.b, foreach='var_1')

    @step
    def b(self):
        print("In B")
        self.next(self.join)

    @step
    def join(self, inputs):
        self.next(self.end)

    @step
    def end(self):
        print("In end")

if __name__ == "__main__":
    NodeSimpleTriggeredFlow()
```

You can trigger it using Typescript code below. This assumes you're using Service Principals for programmatic auth. You can get `configString` for the machine user from OBP UI.

```ts
import { ArgoEventTrigger } from "@outerbounds/events";

// Event name, must match what's in @trigger
let argoEvent = new ArgoEventTrigger("my_event");

// Make sure to initialize the library
await argoEvent.init({ configString: "awssm-arn:..." });

// Trigger the event
await argoEvent.trigger({ foo: "bar" });
```