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.

Introduction

The Lume Client Library runs via the base entry class, Lume.

import { Lume } from "@lume-ai/typescript-sdk";

const lume: Lume = new Lume("api_key");

All functionality is separated into separate services, such as JobService. To access functionality, access the method directly via the service class.

const job = lume.jobService.getJob(jobId);

This Typescript library provides an overview of the classes, methods, and models of the Client Library. You can always refer to the ground truth in the package bundle itself after installing it.

Service Classes

The Lume class contains multiple service classes for interacting with Lume-specific operations.

Service ClassDescription
JobServiceService class for job-related operations. Provides methods for fetching job details, creating jobs, running jobs, etc.
PipelineServiceService class for pipeline-related operations. Provides methods for fetching pipeline details, creating pipelines, updating pipelines, etc.
ResultsServiceService class for result-related operations. Provides methods for fetching result details, fetching job results, and fetching mappings for a result.
WorkshopServiceService class for workshop-related operations. Provides methods for managing workshops, including creation, deletion, and execution.
WorkflowServiceService class for orchestrating workflows involving method calls across services. For workflows involving a single service, see the Workflows methods in the service directly.

Service Methods

JobsService

MethodDescriptionParameters
getJob(jobId)Retrieves details of a specific job.jobId: string - The ID of the job to fetch details for.
getJobs(page, size)Fetches all job data.page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
getJobDataPage(jobId, page, size)Fetches all job data for the specified page.jobId: string - The ID of the job to fetch data for.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
getJobsForPipeline(pipelineId, page, size)Fetches job data for a specific pipeline.pipelineId: string - The ID of the pipeline.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
createJobForPipeline(pipelineId, sourceData)Creates a new job for the specified pipeline.pipelineId: string - The ID of the pipeline.
sourceData: Array<Record<string, any>> - The source data to run the job on.
runJob(jobId, immediate_return)Runs the specified job.jobId: string - The ID of the job to run.
immediate_return: boolean (optional, default: false) - Whether to return immediately after starting the job. This allows for asynchronous job execution and ping the job status later.
getWorkshopsForJob(jobId, page, size)Retrieves workshops associated with a specific job.jobId: string - The ID of the job.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
getTargetSchemaForJob(jobId)Retrieves the target schema for a specific job.jobId: string - The ID of the job.
createAndRunJob(pipelineId, sourceData, immediate_return)Creates a job for the specified pipeline and runs the job.pipelineId: string - The ID of the pipeline.
sourceData: Array<Record<string, any>> - The source data to run the job on.
immediate_return: boolean (optional, default: false) - Whether to return immediately after starting the job. This allows for asynchronous job execution and ping the job status later.

PipelineService

MethodDescriptionParameters
getPipelineDataPage(page, size)Retrieves a page of pipeline data.page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
createPipeline(pipelineCreatePayload)Creates a new pipeline with the provided details.pipelineCreatePayload: PipelineCreatePayload - Details of the pipeline to create.
getPipeline(pipelineId)Retrieves details of a specific pipeline.pipelineId: string - The ID of the pipeline to fetch details for.
updatePipeline(pipelineId, pipelineUpdatePayload)Updates an existing pipeline with the provided details.pipelineId: string - The ID of the pipeline to update.
pipelineUpdatePayload: PipelineUpdatePayload - Details of the pipeline to update.
deletePipeline(pipelineId)Deletes a pipeline with the specified ID.pipelineId: string - The ID of the pipeline to delete.
getWorkshopsForPipeline(pipelineId, page, size)Retrieves workshops associated with a specific pipeline.pipelineId: string - The ID of the pipeline.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
createWorkshopForPipeline(pipelineId)Creates a new workshop for the specified pipeline.pipelineId: string - The ID of the pipeline.
getTargetSchemaForPipeline(pipelineId)Retrieves the target schema for a specific pipeline.pipelineId: string - The ID of the pipeline.
learn(pipelineId, targetPropertyNames)Trains the AI using the pipeline’s lookup tables.pipelineId: string - The ID of the pipeline to train.
targetPropertyNames: string[] (optional) - The target properties to train the AI on.

ResultsService

MethodDescriptionParameters
getResult(resultId)Retrieves details of a specific result.resultId: string - The ID of the result to fetch details for.
getJobResults(jobId, page, size)Retrieves job results associated with a specific job.jobId: string - The ID of the job.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
getSpecForResult(resultId)Retrieves the specification for a specific result.resultId: string - The ID of the result.
getMappingsForResult(resultId, page, size, include_spec)Retrieves mappings associated with a specific result.resultId: string - The ID of the result.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
include_spec: boolean (optional, default: true) - Whether to include the spec of the mapping task.
generateConfidenceScores(resultId)Generates confidence scores for a specific result.resultId: string - The ID of the result.

WorkshopService

MethodDescriptionParameters
getWorkshop(workshopId)Retrieves details of a specific workshop.workshopId: string - The ID of the workshop to fetch details for.
createWorkshopForJob(jobId)Creates a new workshop for the specified job.jobId: string - The ID of the job to create the workshop for.
deleteWorkshop(workshopId)Deletes a workshop with the specified ID.workshopId: string - The ID of the workshop to delete.
runWorkshopMapper(workshopId, workshopWithMapperPayload)Runs the mapper of a workshop with the specified ID.workshopId: string - The ID of the workshop to run the mapper for.
workshopWithMapperPayload: WorkshopWithMapperPayload - Details required for running the mapper.
runWorkshopSample(workshopId, workshopWithSamplePayload)Runs a sample for the workshop with the specified ID.workshopId: string - The ID of the workshop to run the sample for.
workshopWithSamplePayload: WorkshopWithSamplePayload - Details required for running the sample.
runWorkshopTargetSchema(workshopId, workshopWithSchemaPayload)Runs the target schema for the workshop with the specified ID.workshopId: string - The ID of the workshop to run the target schema for.
workshopWithSchemaPayload: WorkshopWithSchemaPayload - Details required for running the target schema.
deployWorkshop(workshopId)Deploys the workshop with the specified ID.workshopId: string - The ID of the workshop to deploy.
getResultsForWorkshop(workshopId, page, size)Retrieves results associated with a specific workshop.workshopId: string - The ID of the workshop.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
runEditCycleWithMapper(jobId, workshopWithMapperPayload)Creates a workshop for a job and runs the workshop with mapper edits.jobId: string - The ID of the job.
workshopWithMapperPayload: WorkshopWithMapperPayload - Details required for mapper edits.
runEditCycleWithSample(jobId, workshopWithSamplePayload)Creates a workshop for a job and runs the workshop with sample edits.jobId: string - The ID of the job.
workshopWithSamplePayload: WorkshopWithSamplePayload - Details required for sample edits.
runEditCycleWithSchema(jobId, workshopWithSchemaPayload)Creates a workshop for a job and runs the workshop with schema edits.jobId: string - The ID of the job.
workshopWithSchemaPayload: WorkshopWithSchemaPayload - Details required for schema edits.

WorkflowService

MethodDescriptionParameters
getObjectWithFilterPage(model, params, page, size)Queries any Lume object with a filter and returns a paginated response.model: string - The model to query.
params: Record<string, any> - The filter parameters to apply.
page: number (optional, default: 1) - The page number to fetch.
size: number (optional, default: 50) - Number of items per page.
executeJobCycle(pipelineId, sourceData)Creates a job for the specified pipeline, runs the job, and returns the mappings for the result.pipelineId: string - The ID of the pipeline.
sourceData: Array<Record<string, any>> - The source data to run the job on.
immediate_return: boolean (optional, default: false) - Whether to return immediately after starting the job. This allows for asynchronous job execution and ping the job status later.
executeJobCycleWithNewPipeline(pipelineCreatePayload, sourceData, mapper)Creates a job for a new pipeline, runs the job, and returns the mappings for the result.pipelineCreatePayload: PipelineCreatePayload - Details of the pipeline to create.
sourceData: Array<Record<string, any>> - The source data to run the job on.
mapper: Array<MapperEditSchema> (optional) - An array of manual mappings to apply to the spec after generation.
generateConfidenceScoreForPipeline(pipelineId)Generates confidence scores for the most recent job in a specific pipeline.pipelineId: string - The ID of the pipeline.

HelperService

MethodDescriptionParameters
convertExcelToJson(file, name, sheets?)Converts an Excel file to JSON using the specified pipeline and job details.file: File | string - The Excel file to convert, File if called from the browser, string if called from Node.js.
name: string - The name of the file.

More Information

Refer to the Client Library Bundle Code, or the API Reference to review the workflows and use the corresponding methods in the Typescript Client Library.