The Lume Typescript Client Library is currently in beta. Please reach out to support if you have any questions, encounter any bugs, or have any feature requests.

Install

Download the Typescript Client Library using your favorite package manager.

Quickstart

Retrieve your input data and target schema.

const targetSchema = {
    type: "object",
    properties: {
        f_name: {
            type: "string",
            description: "The first name of the user",
        },
        l_name: {
            type: "string",
            description: "The last name of the user",
        },
    },
    required: ["f_name", "l_name"],
}

const sourceData = [
    { first_name: "John", last_name: "Doe" },
    { first_name: "Jane", last_name: "Smith" }
]

Create a new pipeline and map data.

import { Lume, Mapping, Pipeline } from '@lume-ai/typescript-sdk';

const lume: Lume = new Lume('api_key')

const createPipeline = async () => {
    const createdPipeline = await lume.pipelineService.createPipeline(
        {
            name: 'sourceX_to_destinationY',
            description: "my_description",
            target_schema: targetSchema
        }
    );
    return createdPipeline;
}


export async function run() {

    // create pipeline and execute job
    const pipeline: Pipeline = await createPipeline(lume);
    const { result, jobId } = await lume.jobsService.createAndRunJob(pipeline.id, sourceData)

    // parse the results and iterate through all mapped records. Note this method is paginated.
    const mappingsPage = await lume.resultsService.getMappingsForResult(result.id, 1, 50);
    const mappings: Mapping[] = mappingsPage.items;

    // use the mappings to access the mapped records
}

run()

Usage

Refer to the Typescript Client Library Methods and Classes for more information.

Issues / Questions

Please reach out to support if you encounter any bugs, have any questions, or have feature requests.