@lume-ai/typescript-sdk
Version:
Lume SDK for Typescript to automate data mappings with AI. Learn more at docs.lume.ai
1 lines • 44.3 kB
Source Map (JSON)
{"version":3,"sources":["../src/models/status.ts","../src/services/ApiClient.ts","../src/utils/retryUtils.ts","../src/models/LumeError.ts","../src/services/SchemaTransformer.ts","../src/services/Run.ts","../src/services/Flow.ts","../src/services/FlowService.ts","../src/index.ts"],"sourcesContent":["export enum Status {\n SUCCEEDED = \"SUCCEEDED\",\n RUNNING = \"RUNNING\",\n INCOMPLETE = \"INCOMPLETE\",\n FAILED = \"FAILED\",\n CREATED = \"CREATED\",\n PENDING = \"PENDING\",\n CRASHED = \"CRASHED\",\n}\n","// apiClient.ts\n\nimport axios, {\n AxiosError,\n AxiosInstance,\n AxiosRequestConfig,\n AxiosResponse,\n InternalAxiosRequestConfig,\n} from \"axios\";\nimport qs from \"qs\";\nimport { HTTPExceptionError } from \"../models/Error\";\nimport { retryWithBackoff } from \"../utils/retryUtils\";\n/**\n * Base service class providing common functionality for other services.\n */\nexport class ApiClient {\n protected httpClient: AxiosInstance;\n\n constructor(apiKey: string, baseURL: string) {\n this.httpClient = axios.create({\n baseURL,\n headers: {\n \"Content-Type\": \"application/json\",\n \"lume-api-key\": apiKey,\n },\n paramsSerializer: (params) => {\n const queryParams: any = { ...params };\n\n // Keep include as an array to get separate include parameters\n // This will result in include=value1&include=value2 format\n\n return qs.stringify(queryParams, {\n arrayFormat: \"repeat\",\n encode: false,\n });\n },\n });\n\n this.initializeInterceptors();\n }\n\n private initializeInterceptors() {\n this.httpClient.interceptors.request.use(\n this.handleRequest,\n this.handleError\n );\n this.httpClient.interceptors.response.use(\n this.handleResponse,\n this.handleError\n );\n }\n\n private handleRequest = (\n config: InternalAxiosRequestConfig\n ): InternalAxiosRequestConfig => {\n // Modify the request if needed\n return config;\n };\n\n private handleResponse = (response: AxiosResponse): AxiosResponse => {\n return response;\n };\n\n private handleError = (error: any): Promise<never> => {\n // Handle Axios Error codes\n if (error.code) {\n switch (error.code) {\n case \"ERR_NETWORK\":\n return Promise.reject({\n code: -1,\n message: \"Network error - please check your internet connection\",\n });\n case \"ERR_INVALID_URL\":\n return Promise.reject({\n code: -2,\n message: `Invalid API URL configuration: ${\n error.config?.baseURL || \"no URL provided\"\n }`,\n });\n case \"ECONNREFUSED\":\n return Promise.reject({\n code: -3,\n message:\n \"Connection refused - server may be down or URL is incorrect\",\n });\n }\n }\n if (error.response) {\n // Extract status and message for known errors\n const code = error.response.status;\n const message =\n error.response.data?.detail ||\n error.response.data?.message ||\n error.message ||\n \"An unknown error occurred\";\n const error_id = error.response.data?.error_id || null;\n\n return Promise.reject({ code, message, error_id });\n }\n\n if (error.request) {\n // Request was made but no response received\n return Promise.reject({\n code: -4,\n message: `No response received from server: ${error.message}`,\n });\n }\n\n // Fallback for any other errors\n return Promise.reject({\n code: -5,\n message: `Request failed: ${error.message || \"Unknown error occurred\"}`,\n detail: error,\n });\n };\n\n // Public methods to be used in other classes\n public async get<T>(\n url: string,\n config?: AxiosRequestConfig,\n baseURLOverride?: string\n ): Promise<T> {\n const finalConfig = { ...config };\n if (baseURLOverride) {\n finalConfig.baseURL = baseURLOverride;\n }\n return retryWithBackoff(() => this.httpClient.get<T>(url, finalConfig).then((res) => res.data));\n }\n\n public async post<T>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n baseURLOverride?: string\n ): Promise<T> {\n const finalConfig = { ...config };\n if (baseURLOverride) {\n finalConfig.baseURL = baseURLOverride;\n }\n return retryWithBackoff(() => this.httpClient.post<T>(url, data, finalConfig).then((res) => res.data));\n }\n\n public async patch<T>(\n url: string,\n data?: any,\n config?: AxiosRequestConfig,\n baseURLOverride?: string\n ): Promise<T> {\n const finalConfig = { ...config };\n if (baseURLOverride) {\n finalConfig.baseURL = baseURLOverride;\n }\n return retryWithBackoff(() => this.httpClient.patch<T>(url, data, finalConfig).then((res) => res.data));\n }\n\n public async delete<T>(\n url: string,\n config?: AxiosRequestConfig,\n baseURLOverride?: string\n ): Promise<T> {\n const finalConfig = { ...config };\n if (baseURLOverride) {\n finalConfig.baseURL = baseURLOverride;\n }\n return retryWithBackoff(() => this.httpClient.delete<T>(url, finalConfig).then((res) => res.data));\n }\n}\n","export async function retryWithBackoff<T>(\n operation: () => Promise<T>, \n retries: number = 5, \n delay: number = 1000, \n factor: number = 2\n ): Promise<T> {\n try {\n return await operation(); // Try executing the request\n } catch (error: any) {\n // List of error codes that should trigger a retry\n const retryableErrorCodes = [408, 429, 502, 503, 504]; // Timeout, rate limit, server errors\n const retryableNetworkErrors = ['ECONNRESET', 'ETIMEDOUT', 'ESOCKETTIMEDOUT', 'ECONNABORTED'];\n \n const shouldRetry = \n retries > 0 && (\n // HTTP status codes\n (error.response && retryableErrorCodes.includes(error.response.status)) ||\n // Axios error codes\n (error.code && retryableNetworkErrors.includes(error.code)) ||\n // Other timeout indicators\n (error.code === 'ERR_NETWORK')\n );\n \n if (!shouldRetry) throw error; // Don't retry if conditions aren't met\n // Get a meaningful error code/status for logging\n const errorCode = error.response?.status || error.code || 'NETWORK_ERROR';\n console.warn(`Request failed with ${errorCode} - retrying in ${delay}ms (${retries} retries left)...`);\n \n // Wait before retrying\n await new Promise((resolve) => setTimeout(resolve, delay));\n \n // Retry recursively with exponential backoff\n return retryWithBackoff(operation, retries - 1, delay * factor, factor);\n }\n }","/**\n * Custom error classes to provide clearer error handling in the SDK.\n * These can capture extra error detail or context if needed.\n */\n\nexport class LumeSDKError extends Error {\n public detail?: any;\n public error_id?: string;\n public statusCode?: number;\n\n constructor(message: any, statusCode?: number, detail?: any, error_id?: string) {\n super(message);\n this.name = \"LumeSDKError\";\n this.statusCode = statusCode;\n this.detail = detail;\n this.error_id = error_id;\n Object.setPrototypeOf(this, LumeSDKError.prototype);\n }\n}\n\nexport class FlowError extends LumeSDKError {\n public flow_id?: string;\n\n constructor(err: any, message?: string, flow_id?: string) {\n \n const statusCode = err.code ?? 500;\n const detail = err.message ?? message ?? \"An unknown error occurred\";\n const error_id = err.error_id ?? undefined;\n let detailMessage = detail;\n if (Array.isArray(detail)) {\n detailMessage = detail[0].msg\n }\n super(detailMessage, statusCode, detail, error_id);\n this.name = \"FlowError\";\n this.flow_id = flow_id;\n Object.setPrototypeOf(this, FlowError.prototype);\n }\n}\n\nexport class RunError extends LumeSDKError {\n public run_id?: string;\n public flow_id?: string;\n\n constructor(err: any, message?: string, run_id?: string, flow_id?: string) {\n const statusCode = err.code ?? 500;\n const detail = err.message ?? message ?? \"An unknown error occurred\";\n const error_id = err.error_id ?? undefined;\n let detailMessage = detail;\n if (Array.isArray(detail)) {\n detailMessage = detail[0].msg\n }\n super(detailMessage, statusCode, detail, error_id);\n this.name = \"RunError\";\n this.run_id = run_id;\n this.flow_id = flow_id;\n Object.setPrototypeOf(this, RunError.prototype);\n }\n}","import { Status } from \"../models/status\";\nimport {\n SchemaTransformer as SchemaTransformerData,\n SchemaTransformerInput,\n SchemaTransformerOutput,\n SchemaTransformerTargetField,\n} from \"../models/schemaTransform\";\nimport { ApiClient } from \"./ApiClient\";\nimport { RunError } from \"../models/LumeError\";\n/**\n * INTERNAL/PRIVATE to handle the \"schema_transform\" step.\n * The user never calls SchemaTransformer directly.\n */\nexport class SchemaTransformer {\n public edit?: { id: string; status: Status };\n public input: SchemaTransformerInput;\n public output: SchemaTransformerOutput;\n public target_fields: SchemaTransformerTargetField[];\n\n public id!: string;\n public type: string;\n public status: Status;\n public created_at: string;\n public updated_at: string;\n public user_id: string;\n public flow_id: string;\n public name: string;\n\n private apiClient!: ApiClient;\n\n constructor(\n apiClient: ApiClient,\n id: string,\n type: string,\n status: Status,\n created_at: string,\n updated_at: string,\n user_id: string,\n input: SchemaTransformerInput,\n output: SchemaTransformerOutput,\n target_fields: SchemaTransformerTargetField[],\n flow_id: string,\n name: string,\n edit?: { id: string; status: Status }\n ) {\n Object.defineProperty(this, \"apiClient\", {\n value: apiClient,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n Object.defineProperty(this, \"id\", {\n value: id,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n this.type = type;\n this.status = status;\n this.created_at = created_at;\n this.updated_at = updated_at;\n this.user_id = user_id;\n this.input = input;\n this.output = output;\n this.target_fields = target_fields;\n this.edit = edit || undefined;\n this.flow_id = flow_id;\n this.name = name;\n }\n\n /**\n * Refreshes the schema transformer details with the latest data from the API,\n * including the output (mapped_data, errors, etc.).\n */\n public async get(\n options: { page?: number; size?: number } = {},\n revalidate?: boolean\n ): Promise<void> {\n const { page = 1, size = 50 } = options;\n const headers = revalidate\n ? {\n \"Cache-Control\": \"no-cache, no-store, must-revalidate\",\n Pragma: \"no-cache\",\n Expires: \"0\",\n }\n : {};\n\n // GET /schema_transformers/{this.id}?page=X&size=Y&validation=true&target_fields=false\n let updatedData: SchemaTransformer;\n try {\n updatedData = await this.apiClient.get<SchemaTransformer>(\n `/schema_transformers/${this.id}`,\n {\n params: {\n page,\n size,\n validation: true,\n target_fields: false,\n },\n headers,\n }\n );\n } catch (err: any) {\n throw new RunError(err, `Failed to refresh schema transformer run${this.id}`, this.id, this.flow_id);\n }\n\n this.type = updatedData.type;\n this.status = updatedData.status;\n this.created_at = updatedData.created_at;\n this.updated_at = updatedData.updated_at;\n this.user_id = updatedData.user_id;\n this.input = updatedData.input;\n this.output = updatedData.output;\n this.target_fields = updatedData.target_fields;\n this.edit = updatedData.edit;\n this.flow_id = updatedData.flow_id;\n this.name = updatedData.name;\n }\n\n /**\n * Returns the raw data model, if needed internally for debugging.\n */\n public async getValues(): Promise<SchemaTransformerData> {\n return {\n id: this.id,\n type: this.type,\n status: this.status,\n created_at: this.created_at,\n updated_at: this.updated_at,\n user_id: this.user_id,\n flow_id: this.flow_id,\n edit: this.edit,\n input: this.input,\n output: this.output,\n target_fields: this.target_fields,\n };\n }\n}\n","import { ApiClient } from \"./ApiClient\";\nimport { Steps } from \"../models/shared\";\nimport { Status } from \"../models/status\";\nimport {\n SchemaTransformerInput,\n SchemaTransformerOutput,\n} from \"../models/schemaTransform\";\nimport { SchemaTransformer } from \"./SchemaTransformer\";\nimport { RunError } from \"../models/LumeError\";\n\n/**\n * Represents a single execution of a flow.\n * The internal steps array may include a schema transform step\n * that we use to retrieve final mapped data.\n */\nexport class Run {\n private apiClient!: ApiClient;\n\n public id: string;\n public type: string;\n public status: Status;\n public created_at: string;\n public updated_at: string;\n public user_id: string;\n public flow_id: string;\n\n public metadata: any;\n public steps?: Steps[];\n public runId?: string;\n public file_name?: string;\n\n constructor(apiClient: ApiClient, runData: any, flow_id: string, run_id?: string) {\n Object.defineProperty(this, \"apiClient\", {\n value: apiClient,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n Object.defineProperty(this, \"flow_id\", {\n value: flow_id,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n this.id = run_id ?? runData.id;\n this.user_id = runData.user_id;\n this.type = runData.type;\n this.flow_id = flow_id;\n this.status = runData.status;\n this.created_at = runData.created_at;\n this.updated_at = runData.updated_at;\n this.metadata = runData.metadata ?? {};\n this.steps = runData.steps;\n }\n\n /**\n * Polls until the run is complete (status = SUCCEEDED/FAILED/CRASHED).\n * If the run ends with a fail status, we throw a RunError with details.\n */\n public async waitForCompletion(pollIntervalMs: number = 1000): Promise<void> {\n while (\n this.status === Status.CREATED ||\n this.status === Status.PENDING ||\n this.status === Status.RUNNING\n ) {\n await new Promise((resolve) => setTimeout(resolve, pollIntervalMs));\n await this.get(); // refresh run status\n }\n }\n\n /**\n * Refresh the Run instance with the latest data from the API.\n * (Your existing code uses the same endpoint to fetch flow data with run_id param.)\n */\n public async get(): Promise<void> {\n let response: any;\n try {\n response = await this.apiClient.get<any>(`/flows/${this.flow_id}`, {\n params: { run_id: this.id },\n });\n } catch (err: any) {\n console.log(\"ERROR\", err);\n throw new RunError(err, `Failed to refresh run ${this.id}`, this.id, this.flow_id);\n }\n // The response is a Flow, so we find the run portion.\n // Depending on your backend, you might get the entire Flow object including steps.\n // We'll assume the server returns just the run if run_id param is present.\n this.user_id = response.user_id;\n this.type = response.type;\n this.status = response.status;\n this.created_at = response.created_at;\n this.updated_at = response.updated_at;\n this.metadata = response.metadata ?? {};\n this.steps = response.steps;\n }\n\n /**\n * Private: returns a typed representation of this run.\n * Possibly used internally for debugging or logging.\n */\n private getValues() {\n return {\n id: this.id,\n type: this.type,\n status: this.status,\n created_at: this.created_at,\n updated_at: this.updated_at,\n user_id: this.user_id,\n flow_id: this.flow_id,\n metadata: this.metadata,\n steps: this.steps,\n runId: this.runId,\n file_name: this.file_name,\n };\n }\n\n /**\n * (Internal Use Only)\n * Called by Flow.getRunResults() to retrieve the \"schema_transform\" step's final output.\n * We do not expose \"SchemaTransformer\" to the user directly.\n */\n public async _getTransformationOutput(\n page: number = 1,\n size: number = 50\n ): Promise<SchemaTransformerOutput | null> {\n // We rely on a \"schema_transform\" step existing in the steps array.\n if (!this.steps || this.steps.length < 1) {\n return null;\n }\n // For demonstration, we assume the second-to-last step is the schema transform,\n // as in your original code:\n const schemaTransformStep = this.steps[this.steps.length - 2];\n if (\n !schemaTransformStep ||\n schemaTransformStep.type !== \"schema_transform\"\n ) {\n return null;\n }\n\n // We'll build a private SchemaTransformer instance to fetch the detailed output\n const transformer = new SchemaTransformer(\n this.apiClient,\n schemaTransformStep.id,\n schemaTransformStep.type,\n schemaTransformStep.status as Status,\n this.created_at,\n this.updated_at,\n this.user_id,\n {} as SchemaTransformerInput,\n {} as SchemaTransformerOutput,\n [],\n this.flow_id,\n this.metadata?.name ?? \"\"\n );\n // This hits /schema_transformers/{transformer.id} with page & size.\n await transformer.get({ page, size });\n return transformer.output;\n }\n}\n","import { ApiClient } from \"./ApiClient\";\nimport { CreateRunDto, SearchRunsDto, Flow as FlowData } from \"../models/flow\";\nimport { Run } from \"./Run\";\nimport { Status } from \"../models/status\";\nimport { Steps } from \"../models/shared\";\nimport { Page } from \"../models/models\";\nimport { FlowError, RunError } from \"../models/LumeError\";\n\n/**\n * Represents a data transformation Flow in Lume.\n * You can create multiple runs, fetch them, or do a quick \"process\" method.\n */\nexport class Flow {\n public id: string;\n public user_id: string;\n public version: number;\n public tags: string[];\n public description: string;\n public steps: Steps[];\n public name: string;\n public status: Status;\n public created_at: string;\n public updated_at: string;\n\n private apiClient!: ApiClient;\n\n constructor(apiClient: ApiClient, data: FlowData) {\n Object.defineProperty(this, \"apiClient\", {\n value: apiClient,\n enumerable: false,\n writable: true,\n configurable: true,\n });\n\n this.id = data.id;\n this.user_id = data.user_id;\n this.version = data.version;\n this.tags = data.tags.map((tag) => `${tag.key}:${tag.value}`);\n this.description = data.description;\n this.steps = data.steps;\n this.name = data.name;\n this.status = data.status;\n this.created_at = data.created_at;\n this.updated_at = data.updated_at;\n }\n\n /**\n * Refreshes the flow's data from the API.\n */\n public async get(): Promise<void> {\n let flowData: FlowData;\n try {\n flowData = await this.apiClient.get<FlowData>(`/flows/${this.id}`);\n } catch (err: any) {\n throw new FlowError(err, `Failed to refresh flow with ID ${this.id}`, this.id);\n }\n this.version = flowData.version;\n this.tags = flowData.tags.map((tag) => `${tag.key}:${tag.value}`);\n this.description = flowData.description;\n this.steps = flowData.steps;\n this.name = flowData.name;\n this.status = flowData.status;\n this.created_at = flowData.created_at;\n this.updated_at = flowData.updated_at;\n }\n\n /**\n * Creates a new run of this flow with provided data.\n * If wait=true, this method polls until the run is complete.\n */\n public async createRun(\n data: CreateRunDto,\n wait: boolean = false\n ): Promise<Run> {\n let newRunData: any;\n try {\n newRunData = await this.apiClient.post<any>(\n `/flows/${this.id}/runs`,\n data\n );\n } catch (err: any) {\n throw new FlowError(err, `Failed to create run for flow ${this.id}`, this.id);\n }\n\n const run = new Run(this.apiClient, newRunData, this.id);\n if (wait) {\n await run.waitForCompletion();\n }\n return run;\n }\n\n /**\n * Fetches a specific run by run ID from this flow.\n */\n public async getRun(run_id: string): Promise<Run> {\n let response: any;\n try {\n // The server expects run_id as a param for the same /flows/{id} endpoint.\n response = await this.apiClient.get<any>(`/flows/${this.id}`, {\n params: { run_id },\n });\n } catch (err: any) {\n throw new RunError(err, `Failed to get run ${run_id} for flow ${this.id}`, run_id, this.id);\n }\n return new Run(this.apiClient, response, this.id, run_id);\n \n }\n\n /**\n * Fetches all runs for this flow.\n */\n public async getRuns(page: number = 1, size: number = 50): Promise<Page<Run>> {\n let response: Page<Run>;\n try {\n response = await this.apiClient.get<Page<Run>>(\n `/flows/${this.id}/runs`,\n {\n params: {\n page,\n size\n }\n }\n );\n } catch (err: any) {\n throw new FlowError(err, `Failed to get runs for flow ${this.id}`, this.id);\n }\n return {\n items: response.items.map((runData) => new Run(this.apiClient, runData, this.id)),\n total: response.total,\n page,\n size,\n pages: response.pages\n };\n \n }\n\n /**\n * Searches for runs by name, tags_filter, and version_id\n */\n public async searchRuns(\n searchDto: SearchRunsDto,\n page: number = 1,\n size: number = 50\n ): Promise<Page<Run>> {\n let response: Page<Run>;\n try {\n response = await this.apiClient.post<Page<Run>>(`/flows/${this.id}/runs/search`, searchDto, {\n params: {\n page,\n size\n }\n });\n } catch (err: any) {\n throw new FlowError(err, `Failed to search runs for flow ${this.id}`, this.id);\n }\n return {\n items: response.items.map((runData) => new Run(this.apiClient, runData, this.id)),\n total: response.total,\n page,\n size,\n pages: response.pages\n };\n }\n \n\n /**\n * High-level method: processes new data through this flow,\n * waits for the run to complete, and returns the final mapped results.\n */\n public async process(\n sourceData: any[],\n page: number = 1,\n size: number = 50\n ): Promise<Page<any>> {\n // 1) Create and wait for run\n const run = await this.createRun({ source_data: sourceData }, true);\n // 2) Use a private or internal method to retrieve the final data from the run\n return this.getRunResults(run, page, size);\n }\n\n /**\n * Gets results from a specific run with pagination.\n * Internally calls run.getSchemaTransformerOutput,\n * which is where the real step logic is hidden.\n */\n public async getRunResults(\n run: Run,\n page: number = 1,\n size: number = 50\n ): Promise<Page<any>> {\n const output = await run._getTransformationOutput(page, size);\n // The shape of output?.mapped_data is { items: [...], total: number }\n // Provide a default if null\n return output?.mapped_data || { items: [], total: 0 };\n }\n\n /**\n * A new method that directly fetches run results by run ID.\n * Useful in concurrency scenarios: you always fetch the exact run you want.\n */\n public async getRunResultsById(\n runId: string,\n page: number = 1,\n size: number = 50\n ): Promise<Page<any>> {\n const run = await this.getRun(runId);\n return this.getRunResults(run, page, size);\n }\n\n /**\n * Gets the results from the most recent successful run,\n * or null if none exist.\n */\n public async getLatestRunResults(\n page: number = 1,\n size: number = 50\n ): Promise<Page<any> | null> {\n const runs = await this.getRuns();\n if (runs?.total === 0) return null;\n\n // Find the most recent successful run\n const latestSuccessfulRun = runs.items.find(\n (r) => r.status === Status.SUCCEEDED\n );\n if (!latestSuccessfulRun) return null;\n\n const run = await this.getRun(latestSuccessfulRun.id);\n if (!run) return null;\n\n return this.getRunResults(run, page, size);\n }\n}\n","import { ApiClient } from \"./ApiClient\";\nimport { Flow } from \"./Flow\";\nimport { CreateFlowDto, CreateRunDto, SearchFlowsDto, Flow as FlowData } from \"../models/flow\";\nimport { Page } from \"../models/models\";\nconst throat = require(\"throat\");\nimport { FlowError } from \"../models/LumeError\";\n\n/**\n * An optional concurrency or callback-based approach.\n * If concurrency is set, we wrap calls in throat. Otherwise, no limit.\n */\nexport class FlowService {\n private apiClient: ApiClient;\n\n private concurrencyLimit: number;\n private requestQueue: ReturnType<typeof throat> | null;\n\n constructor(apiClient: ApiClient, concurrencyLimit: number = 0) {\n this.apiClient = apiClient;\n this.concurrencyLimit = concurrencyLimit;\n this.requestQueue = concurrencyLimit > 0 ? throat(concurrencyLimit) : null;\n }\n\n /**\n * Creates a new flow, THEN executes the initial run using runData.\n * If `wait` is true, it waits for that initial run to finish.\n *\n * Some users prefer a single call so that no flow is created without data.\n */\n public async createAndRunFlow(\n flowData: CreateFlowDto,\n runData: CreateRunDto,\n wait: boolean = false\n ): Promise<Flow> {\n const executor = async () => {\n // 1) Create flow\n let flowObj: FlowData;\n try {\n flowObj = await this.apiClient.post<FlowData>(\"/flows\", flowData);\n } catch (err: any) {\n // More specific error messages based on the type of error\n throw new FlowError(err, \"Failed to create flow.\");\n }\n\n const flow = new Flow(this.apiClient, flowObj);\n\n // 2) Create initial run\n await flow.createRun(runData, wait);\n \n return flow;\n };\n\n if (this.requestQueue) {\n // If concurrency limit is set, enqueue it\n return this.requestQueue(executor);\n }\n // Otherwise just run directly\n return executor();\n }\n\n /**\n * Retrieves a flow by ID.\n */\n public async getFlow(id: string): Promise<Flow> {\n if (!id) throw new Error(\"Flow ID is required\");\n let flowData: FlowData;\n try {\n flowData = await this.apiClient.get<FlowData>(`/flows/${id}`);\n } catch (err: any) {\n throw new FlowError(err, `Failed to retrieve flow ID: ${id}`, id);\n }\n return new Flow(this.apiClient, flowData);\n }\n\n /**\n * Creates a new flow without an initial run (less common),\n * but you can still do `flow.createRun(...)` after.\n */\n public async createFlow(data: CreateFlowDto): Promise<Flow> {\n let flowData: FlowData;\n try {\n flowData = await this.apiClient.post<FlowData>(\"/flows\", data);\n } catch (err: any) {\n throw new FlowError(err, \"Failed to create flow.\");\n }\n return new Flow(this.apiClient, flowData);\n }\n\n /**\n * Retrieves all flows.\n */\n public async getFlows(page: number = 1, size: number = 50): Promise<Page<Flow>> {\n let response: Page<FlowData>;\n try {\n response = await this.apiClient.get<Page<FlowData>>(\"/flows\", {\n params: {\n page,\n size\n }\n });\n } catch (err: any) {\n throw new FlowError(err, \"Failed to retrieve flows.\");\n }\n return {\n items: response.items.map((flow) => new Flow(this.apiClient, flow)),\n total: response.total,\n page,\n size,\n pages: response.pages\n };\n }\n\n /**\n * Searches for flows by name or tags_filter.\n */\n public async searchFlows(\n searchDto: SearchFlowsDto,\n page: number = 1,\n size: number = 50\n ): Promise<Page<Flow>> {\n let response: Page<FlowData>;\n try {\n response = await this.apiClient.post<Page<FlowData>>(\"/flows/search\", searchDto, {\n params: {\n page, \n size\n }\n });\n } catch (err: any) {\n throw new FlowError(err, \"Failed to search flows.\");\n }\n return {\n items: response.items.map((flow) => new Flow(this.apiClient, flow)),\n total: response.total,\n page,\n size,\n pages: response.pages\n };\n }\n \n}\n","// services_v3/Lume.ts\n\n// include interface models\n\nimport {\n Flow,\n CreateFlowDto,\n SearchFlowsDto,\n SearchRunsDto,\n Run,\n CreateRunDto,\n CreateDataJoinRunDto,\n} from \"./models/flow\";\nimport { Page } from \"./models/models\";\nimport { Schema, TargetSchema } from \"./models/Schema\";\nimport { Steps, BaseModel } from \"./models/shared\";\nimport {\n SchemaTransformer,\n SchemaTransformerInput,\n SchemaTransformerOutput,\n SchemaTransformerTargetField,\n} from \"./models/schemaTransform\";\nimport { Status } from \"./models/status\";\n\nimport { ApiClient } from \"./services/ApiClient\";\nimport { FlowService } from \"./services/FlowService\";\n\n// Import other services as they are created\n// import { AnotherService } from './AnotherService';\nimport { Flow as FlowClass } from \"./services/Flow\";\nimport { Run as RunClass } from \"./services/Run\";\nconst PROD_ENDPOINT = \"https://api.lume-terminus.com\";\n/**\n * Lume AI TypeScript SDK\n * Main entry point for interacting with the Lume AI API.\n *\n * @example\n * ```typescript\n * import { Lume } from '@lume-ai/typescript-sdk';\n *\n * const lume = new Lume('your-api-key');\n * const flow = await lume.flowService.createFlow({\n * name: 'My Flow',\n * description: 'Data transformation flow',\n * target_schema: mySchema,\n * tags: ['production']\n * });\n * ```\n */\nexport class Lume {\n public flowService: FlowService;\n // public anotherService: AnotherService;\n\n private apiClient: ApiClient;\n\n /**\n * Initializes the Lume SDK.\n * @param apiKey - Your Lume API authentication key\n * @param baseURL - Optional custom API endpoint (defaults to production)\n */\n constructor(apiKey: string, baseURL: string = PROD_ENDPOINT) {\n this.apiClient = new ApiClient(apiKey, baseURL);\n this.flowService = new FlowService(this.apiClient);\n // Initialize other services similarly\n // this.anotherService = new AnotherService(this.apiClient);\n }\n}\n\nexport {\n FlowClass,\n RunClass,\n Flow,\n Run,\n CreateFlowDto,\n SearchFlowsDto,\n SearchRunsDto,\n CreateRunDto,\n CreateDataJoinRunDto,\n Page,\n Schema,\n TargetSchema,\n Steps,\n BaseModel,\n SchemaTransformer,\n SchemaTransformerInput,\n SchemaTransformerOutput,\n SchemaTransformerTargetField,\n Status,\n};\n"],"mappings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