2.1.29 • Published 13 days ago

@lume-ai/typescript-sdk v2.1.29

Weekly downloads
-
License
MIT
Repository
github
Last release
13 days ago

Status

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

Installation

npm install @lume-ai/typescript-sdk
yarn add @lume-ai/typescript-sdk
pnpm add @lume-ai/typescript-sdk

Quickstart

Create a new pipeline and map data.

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

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

const createPipeline = async () => {
    const pipelineCreatePayload: PipelineCreatePayload = {
        name: 'pipeline_name3',
        description: "description",
        target_schema: {
          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 createdPipeline = await lume.pipelineService.createPipeline(
        pipelineDetails
      );
      return createdPipeline;
}

const createJob = async (pipelineId: string) => {
    const jobCreatePayload: JobCreatePayload = {
        data: [
          {
            first_name: "John",
            last_name: "Doe",
          },
          {
            first_name: "Jane",
            last_name: "Doe",
          },
        ],
      };

      const createdJob = await lume.jobsService.createJobForPipeline(
        pipelineId,
        params
      );

      return createdJob;
}


const run = async () => {
    
    // create pipeline and job
    const pipeline: Pipeline = await createPipeline();
    const job: Job = await createJob(pipeline.id);

    // trigger the mapping generation
    const result: Result = await lume.jobsService.runJob(job.id);

    // parse the results and iterate through all mapped records
    const mappingsPage = await lume.resultsService.getMappingsForResult(result.id); 
    const mappings: Mapping[] = mappingsPage.items;

    for (const mapping of mappings) {
        console.log("mapped record", mapping.mapped_record)
    }
}

run();

Documentation

See the full documentation.

Issues / Questions

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

2.1.27

13 days ago

2.1.28

13 days ago

2.1.25

13 days ago

2.1.24

13 days ago

2.1.29

13 days ago

2.1.23

16 days ago

2.1.22

16 days ago

2.1.21

24 days ago

2.1.20

25 days ago

2.1.18

25 days ago

2.1.19

25 days ago

2.1.16

25 days ago

2.1.17

25 days ago

2.1.15

25 days ago

2.1.14

29 days ago

2.1.13

29 days ago

2.1.12

1 month ago

2.1.8

1 month ago

2.1.10

1 month ago

2.1.11

1 month ago

2.1.6

1 month ago

2.1.5

1 month ago

2.1.7

1 month ago

2.1.4

2 months ago

2.1.3

2 months ago

2.1.2

2 months ago

2.1.1

2 months ago

2.1.0

2 months ago

1.1.1

2 months ago

2.0.3

2 months ago

2.0.2

2 months ago

2.0.4

2 months ago

2.0.1

2 months ago

1.1.0

2 months ago

1.0.12

2 months ago

1.0.11

2 months ago

1.0.10

2 months ago

1.0.9

2 months ago

1.0.8

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.3

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago