0.10.67 • Published 5 days ago

airbyte-faros-destination v0.10.67

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 days ago

Faros Destination for Airbyte

Faros Destination is a universal destination to import data from any Airbyte source into Faros.

Each source stream is handled by an appropriate Converter implementation. Here are all the supported sources.

Any additional source streams can be handled by providing a JSONata expression for the built-in JSONataConverter or by implementing converters for the streams (read more below).

npm.io

Usage

Run from Airbyte

  1. Open Airbyte UI
  2. Go to Settings -> Destinations -> New Connector
  3. Set image - farosai/airbyte-faros-destination
  4. Set documentation - https://github.com/faros-ai/airbyte-connectors
  5. Set the desired version x.y.z, e.g the latest npm.io
  6. Click Add

More details on how to add a custom connector can be found in the official Airbyte guide.

Run from Terminal

docker pull farosai/airbyte-faros-destination
docker run farosai/airbyte-faros-destination

Adding Support for Additional Sources

Faros Destination is built to be easily extensible to support additional sources by adding stream converters.

Well-Known Sources

For well-known sources you can simply open a PR against this repository and add any new stream converters. We are always happy for you to contribute them to the community.

When developing a converter, there is a specific naming convention that must be followed to ensure that the converter is correctly picked up by the Faros Destination. The converter class name must be the PascalCase (or UpperCamelCase) version of the stream name, e.g. PullRequestStats for GitHub.

For testing, create the all-streams.log file and make sure that no real data is included. Also, ensure that the stream names are prefixed with the stream prefix specified in the test file. For example: mytestsource__github__.

We have implemented a lot of converters already so you have plenty examples to follow.

Custom Sources

For custom or internal sources, you can use Faros Destination as an npm package in your project without having to fork or open PRs against this repo. For a complete example, check out the Custom Faros Destination Example repository.

npm i airbyte-faros-destination

The library currently provides a main class FarosDestinationRunner which allows you to register the custom converters you created. Additionally, use the program property to get a default CLI app that provides the basic commands needed to write records to Faros.

Example index.ts:

import {Command} from 'commander';
import {AirbyteRecord} from 'faros-airbyte-cdk';
import {Converter,DestinationModel,DestinationRecord,FarosDestinationRunner,StreamContext} from 'airbyte-faros-destination'

class Builds extends Converter {
  source = 'CustomSource'
  destinationModels = ['cicd_Build'];

  id(record: AirbyteRecord): string {
    return record.record.data.id;
  }

  async convert(
    record: AirbyteRecord,
    ctx: StreamContext
  ): Promise<ReadonlyArray<DestinationRecord>> {
    const build = record.record.data
    return [
      {
        model: 'cicd_Build',
        record: {
          uid: String(build.bid),
          startedAt: new Date(build.created_at),
          endedAt: new Date(build.finished_at),
          status: build.status,
          source: this.source
        },
      },
    ];
  }
}

class Pipelines extends Converter {
  // similar to the Builds in the example above
  ...
}

// Main entry point
export function mainCommand(): Command {
  const destinationRunner = new FarosDestinationRunner();

  // Register your custom converter(s)
  destinationRunner.registerConverters(
    new Builds(),
    new Pipelines()
  );

  return destinationRunner.program;
}

Example shell script to run file bin/main:

#!/usr/bin/env node

const {mainCommand} = require('../lib');

mainCommand().parseAsync(process.argv).catch((err) => {
  console.error(err.message);
  process.exit(1);
});

Writing Records into Faros

./bin/main write --config config.json --catalog catalog.json

You will need to provide two parameters, a config.json which specifies the details of the Faros destination to write to, and catalog.json to document source streams to write records for.

Example config.json

{
  "edition_configs": {
    "edition": "cloud",
    "api_url": "https://prod.api.faros.ai",
    "api_key": "<my_faros_api_key>",
    "graph": "default"
  },
  "origin": "mydatasource"
}

See spec.json for more properties for the config.json

Example catalog.json

{
  "streams": [
    {
      "stream": {
        "name": "mydatasource__CustomSource__builds"
      },
      "destination_sync_mode": "append"
    },
    {
      "stream": {
        "name": "mydatasource__CustomSource__pipelines"
      },
      "destination_sync_mode": "append"
    }
  ]
}

To view debug logs from airbyte, set the following environment variable:

export LOG_LEVEL="debug";
./bin/main write --config config.json --catalog catalog.json;

Tip: you can even pipe data directly from your custom source into your custom destination without Airbyte server while prefixing your streams (as expected by Faros Destination):

<my-source-command> | jq -c -R 'fromjson? | select(.type == "RECORD") | .record.stream = "mydatasource__CustomSource__\(.record.stream)"' | <my-destination-command>

Additional Commands

Run ./bin/main --help for detailed information on available commands.

Visual Studio Code Debugging

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "launch",
            "name": "Launch Program",
            "skipFiles": [
                "<node_internals>/**"
            ],
            "program": "destinations/airbyte-faros-destination/bin/main",
            "console": "integratedTerminal",
            "args": [
                "write",
                "--config", "config.json",
                "--catalog", "catalog.json",
                "<", "streams.log"
              ]
        }
    ]
}

Don't forget to rebuild after code changes

0.10.65

11 days ago

0.10.66

10 days ago

0.10.67

5 days ago

0.10.61

17 days ago

0.10.62

16 days ago

0.10.63

15 days ago

0.10.64

15 days ago

0.10.60

18 days ago

0.10.58

25 days ago

0.10.59

23 days ago

0.10.56

1 month ago

0.10.57

1 month ago

0.10.54

1 month ago

0.10.55

1 month ago

0.10.52

1 month ago

0.10.53

1 month ago

0.10.50

1 month ago

0.10.51

1 month ago

0.10.31

2 months ago

0.10.36

2 months ago

0.10.37

2 months ago

0.10.38

2 months ago

0.10.39

2 months ago

0.10.32

2 months ago

0.10.33

2 months ago

0.10.34

2 months ago

0.10.35

2 months ago

0.10.40

2 months ago

0.10.41

2 months ago

0.10.42

1 month ago

0.10.47

1 month ago

0.10.48

1 month ago

0.10.49

1 month ago

0.10.44

1 month ago

0.10.45

1 month ago

0.10.46

1 month ago

0.10.20

3 months ago

0.10.29

2 months ago

0.10.25

3 months ago

0.10.26

3 months ago

0.10.27

2 months ago

0.10.28

2 months ago

0.10.21

3 months ago

0.10.22

3 months ago

0.10.23

3 months ago

0.10.24

3 months ago

0.10.30

2 months ago

0.10.18

3 months ago

0.10.19

3 months ago

0.10.16

3 months ago

0.10.17

3 months ago

0.10.14

3 months ago

0.10.15

3 months ago

0.10.11

3 months ago

0.10.12

3 months ago

0.10.13

3 months ago

0.10.9

4 months ago

0.10.10

4 months ago

0.10.6

4 months ago

0.10.7

4 months ago

0.10.8

4 months ago

0.10.3

4 months ago

0.10.4

4 months ago

0.10.5

4 months ago

0.10.2

4 months ago

0.10.1

4 months ago

0.10.0

4 months ago

0.9.96

4 months ago

0.9.97

4 months ago

0.9.98

4 months ago

0.9.99

4 months ago

0.9.92

5 months ago

0.9.93

5 months ago

0.9.94

5 months ago

0.9.95

5 months ago

0.9.90

5 months ago

0.9.91

5 months ago

0.9.89

5 months ago

0.9.86

5 months ago

0.9.87

5 months ago

0.9.88

5 months ago

0.9.85

5 months ago

0.9.82

5 months ago

0.9.83

5 months ago

0.9.84

5 months ago

0.9.81

5 months ago

0.9.80

6 months ago

0.9.79

6 months ago

0.9.78

6 months ago

0.9.74

6 months ago

0.9.75

6 months ago

0.9.76

6 months ago

0.9.77

6 months ago

0.9.73

6 months ago

0.9.71

6 months ago

0.9.72

6 months ago

0.9.70

6 months ago

0.9.67

6 months ago

0.9.68

6 months ago

0.9.69

6 months ago

0.9.64

6 months ago

0.9.65

6 months ago

0.9.66

6 months ago

0.9.63

6 months ago

0.9.62

6 months ago

0.9.60

6 months ago

0.9.61

6 months ago

0.9.59

6 months ago

0.9.57

7 months ago

0.9.58

7 months ago

0.9.56

7 months ago

0.9.54

7 months ago

0.9.55

7 months ago

0.9.53

7 months ago

0.9.52

7 months ago

0.9.51

7 months ago

0.9.50

7 months ago

0.9.49

7 months ago

0.9.47

7 months ago

0.9.48

7 months ago

0.9.46

7 months ago

0.9.45

8 months ago

0.9.44

8 months ago

0.9.42

8 months ago

0.9.43

8 months ago

0.9.41

8 months ago

0.9.40

8 months ago

0.9.36

8 months ago

0.9.37

8 months ago

0.9.38

8 months ago

0.9.39

8 months ago

0.9.34

8 months ago

0.9.35

8 months ago

0.9.33

8 months ago

0.9.31

8 months ago

0.9.32

8 months ago

0.9.30

8 months ago

0.9.28

8 months ago

0.9.29

8 months ago

0.9.27

8 months ago

0.9.25

8 months ago

0.9.26

8 months ago

0.9.23

9 months ago

0.9.24

8 months ago

0.9.20

9 months ago

0.9.21

9 months ago

0.9.22

9 months ago

0.9.19

9 months ago

0.9.18

9 months ago

0.9.17

9 months ago

0.9.15

10 months ago

0.9.16

10 months ago

0.9.13

10 months ago

0.9.14

10 months ago

0.9.12

10 months ago

0.9.11

10 months ago

0.9.10

10 months ago

0.9.8

11 months ago

0.9.9

11 months ago

0.9.7

11 months ago

0.9.6

11 months ago

0.9.4

11 months ago

0.9.3

11 months ago

0.9.5

11 months ago

0.9.1

11 months ago

0.8.4

11 months ago

0.9.0

11 months ago

0.8.3

11 months ago

0.8.2

11 months ago

0.8.0

11 months ago

0.7.4

12 months ago

0.7.3

12 months ago

0.7.6

12 months ago

0.7.5

12 months ago

0.7.2

12 months ago

0.7.1

12 months ago

0.7.0

12 months ago

0.0.1

1 year ago

0.6.21

1 year ago

0.5.54

1 year ago

0.6.20

1 year ago

0.5.55

1 year ago

0.6.23

1 year ago

0.5.52

1 year ago

0.6.22

1 year ago

0.5.53

1 year ago

0.6.7

1 year ago

0.5.50

1 year ago

0.6.6

1 year ago

0.5.51

1 year ago

0.6.9

1 year ago

0.6.8

1 year ago

0.6.29

1 year ago

0.6.28

1 year ago

0.6.25

1 year ago

0.6.24

1 year ago

0.6.27

1 year ago

0.5.56

1 year ago

0.6.26

1 year ago

0.6.10

1 year ago

0.5.43

1 year ago

0.5.44

1 year ago

0.6.12

1 year ago

0.5.41

1 year ago

0.6.11

1 year ago

0.5.42

1 year ago

0.5.40

1 year ago

0.6.18

1 year ago

0.5.49

1 year ago

0.6.19

1 year ago

0.6.14

1 year ago

0.5.47

1 year ago

0.6.13

1 year ago

0.5.48

1 year ago

0.6.16

1 year ago

0.5.45

1 year ago

0.6.15

1 year ago

0.5.46

1 year ago

0.5.38

1 year ago

0.5.39

1 year ago

0.6.3

1 year ago

0.6.2

1 year ago

0.6.5

1 year ago

0.6.4

1 year ago

0.6.1

1 year ago

0.6.0

1 year ago

0.6.43

1 year ago

0.6.42

1 year ago

0.6.45

1 year ago

0.6.44

1 year ago

0.6.41

1 year ago

0.6.40

1 year ago

0.6.47

12 months ago

0.6.46

1 year ago

0.6.48

12 months ago

0.6.32

1 year ago

0.6.31

1 year ago

0.6.34

1 year ago

0.6.33

1 year ago

0.6.30

1 year ago

0.6.39

1 year ago

0.6.36

1 year ago

0.6.35

1 year ago

0.6.38

1 year ago

0.6.37

1 year ago

0.5.36

1 year ago

0.5.37

1 year ago

0.5.35

1 year ago

0.5.18

2 years ago

0.5.19

2 years ago

0.5.16

2 years ago

0.5.17

2 years ago

0.5.14

2 years ago

0.5.15

2 years ago

0.5.32

1 year ago

0.5.33

1 year ago

0.5.30

1 year ago

0.5.31

1 year ago

0.5.21

2 years ago

0.5.22

1 year ago

0.5.20

2 years ago

0.5.29

1 year ago

0.5.27

1 year ago

0.5.28

1 year ago

0.5.25

1 year ago

0.5.26

1 year ago

0.5.23

1 year ago

0.5.24

1 year ago

0.5.10

2 years ago

0.5.11

2 years ago

0.5.12

2 years ago

0.5.13

2 years ago

0.5.6

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.9

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.5

2 years ago

0.4.86

2 years ago

0.4.87

2 years ago

0.4.84

2 years ago

0.4.85

2 years ago

0.4.82

2 years ago

0.4.83

2 years ago

0.4.80

2 years ago

0.4.81

2 years ago

0.4.88

2 years ago

0.4.89

2 years ago

0.4.79

2 years ago

0.4.77

2 years ago

0.4.78

2 years ago

0.5.0

2 years ago

0.5.1

2 years ago

0.4.91

2 years ago

0.4.90

2 years ago

0.4.42

2 years ago

0.4.43

2 years ago

0.4.40

2 years ago

0.4.41

2 years ago

0.4.48

2 years ago

0.4.49

2 years ago

0.4.46

2 years ago

0.4.47

2 years ago

0.4.44

2 years ago

0.4.45

2 years ago

0.4.32

2 years ago

0.4.39

2 years ago

0.4.38

2 years ago

0.4.75

2 years ago

0.4.76

2 years ago

0.4.73

2 years ago

0.4.74

2 years ago

0.4.71

2 years ago

0.4.72

2 years ago

0.4.70

2 years ago

0.4.64

2 years ago

0.4.65

2 years ago

0.4.62

2 years ago

0.4.63

2 years ago

0.4.60

2 years ago

0.4.61

2 years ago

0.4.68

2 years ago

0.4.69

2 years ago

0.4.66

2 years ago

0.4.67

2 years ago

0.4.53

2 years ago

0.4.54

2 years ago

0.4.51

2 years ago

0.4.52

2 years ago

0.4.50

2 years ago

0.4.59

2 years ago

0.4.57

2 years ago

0.4.58

2 years ago

0.4.56

2 years ago

0.4.31

2 years ago

0.4.30

2 years ago

0.4.29

2 years ago

0.4.28

2 years ago

0.4.27

2 years ago

0.4.26

2 years ago

0.4.25

2 years ago

0.4.24

2 years ago

0.4.23

2 years ago

0.4.22

2 years ago

0.4.21

2 years ago

0.4.20

2 years ago

0.4.19

2 years ago

0.4.18

2 years ago

0.4.17

2 years ago

0.4.16

2 years ago

0.4.15

2 years ago

0.4.14

2 years ago

0.4.13

2 years ago

0.4.12

2 years ago

0.4.11

2 years ago

0.4.10

2 years ago

0.4.9

2 years ago

0.4.8

2 years ago

0.4.7

2 years ago

0.4.6

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.4.1

2 years ago

0.4.0

2 years ago

0.3.10

2 years ago

0.3.9

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.46

2 years ago

0.2.44

2 years ago

0.2.43

2 years ago

0.2.42

2 years ago

0.2.41

2 years ago

0.2.40

2 years ago

0.2.39

2 years ago

0.2.38

2 years ago

0.2.37

2 years ago

0.2.36

2 years ago

0.2.35

2 years ago

0.2.34

2 years ago

0.2.33

2 years ago

0.2.32

2 years ago

0.2.31

2 years ago

0.2.30

2 years ago

0.2.29

2 years ago

0.2.28

2 years ago

0.2.27

2 years ago

0.2.26

2 years ago

0.2.25

2 years ago

0.2.24

2 years ago

0.2.23

2 years ago

0.2.22

2 years ago

0.2.21

2 years ago

0.2.20

2 years ago

0.2.19

2 years ago

0.2.18

2 years ago

0.2.17

2 years ago

0.2.16

2 years ago

0.2.15

2 years ago

0.2.14

2 years ago

0.2.13

2 years ago

0.2.12

2 years ago

0.2.11

2 years ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.105

2 years ago

0.1.104

2 years ago

0.1.103

2 years ago

0.1.101

2 years ago

0.1.99

2 years ago

0.1.98

2 years ago

0.1.97

2 years ago

0.1.96

2 years ago

0.1.95

2 years ago

0.1.94

2 years ago

0.1.93

2 years ago

0.1.92

2 years ago

0.1.91

2 years ago

0.1.90

2 years ago

0.1.89

2 years ago

0.1.88

2 years ago

0.1.87

2 years ago

0.1.86

2 years ago

0.1.85

2 years ago

0.1.84

3 years ago

0.1.83

3 years ago

0.1.82

3 years ago

0.1.81

3 years ago

0.1.80

3 years ago

0.1.79

3 years ago

0.1.78

3 years ago

0.1.77

3 years ago

0.1.76

3 years ago

0.1.75

3 years ago

0.1.74

3 years ago

0.1.73

3 years ago

0.1.72

3 years ago

0.1.71

3 years ago

0.1.70

3 years ago

0.1.69

3 years ago

0.1.68

3 years ago

0.1.67

3 years ago

0.1.66

3 years ago

0.1.65

3 years ago

0.1.64

3 years ago

0.1.63

3 years ago

0.1.62

3 years ago

0.1.61

3 years ago

0.1.60

3 years ago

0.1.59

3 years ago

0.1.58

3 years ago

0.1.57

3 years ago

0.1.56

3 years ago

0.1.55

3 years ago

0.1.54

3 years ago

0.1.53

3 years ago