@514labs/moose-lib 0.6.296 → 0.6.297-ci-28-g84f3192e

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1566,13 +1566,24 @@ declare class IngestApi<T> extends TypedBase<T, IngestConfig<T>> {
1566
1566
  constructor(name: string, config: IngestConfig<T>, schema: IJsonSchemaCollection$1.IV3_1, columns: Column[], validators: undefined, allowExtraFields: boolean);
1567
1567
  }
1568
1568
 
1569
- interface ApiUtil {
1569
+ /**
1570
+ * Utilities provided by getMooseUtils() for database access and SQL queries.
1571
+ * Works in both Moose runtime and standalone contexts.
1572
+ */
1573
+ interface MooseUtils {
1570
1574
  client: MooseClient;
1571
1575
  sql: typeof sql;
1572
- jwt: JWTPayload | undefined;
1576
+ jwt?: JWTPayload;
1573
1577
  }
1574
- /** @deprecated Use ApiUtil instead. */
1575
- type ConsumptionUtil = ApiUtil;
1578
+ /**
1579
+ * @deprecated Use MooseUtils instead. ApiUtil is now a type alias to MooseUtils
1580
+ * and will be removed in a future version.
1581
+ *
1582
+ * Migration: Replace `ApiUtil` with `MooseUtils` in your type annotations.
1583
+ */
1584
+ type ApiUtil = MooseUtils;
1585
+ /** @deprecated Use MooseUtils instead. */
1586
+ type ConsumptionUtil = MooseUtils;
1576
1587
  declare class MooseClient {
1577
1588
  query: QueryClient;
1578
1589
  workflow: WorkflowClient;
@@ -2144,4 +2155,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
2144
2155
  _argType?: ArgType;
2145
2156
  };
2146
2157
 
2147
- export { toQuery as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, type ApiUtil as K, LifeCycle as L, MaterializedView as M, type ConsumptionUtil as N, OlapTable as O, quoteIdentifier as P, type IdentifierBrandedString as Q, type NonIdentifierBrandedString as R, type SimpleAggregated as S, Task as T, type Value as U, View as V, Workflow as W, type RawValue as X, sql as Y, Sql as Z, toStaticQuery as _, type OlapConfig as a, toQueryPreview as a0, getValueFromParameter as a1, createClickhouseParameter as a2, mapToClickHouseType as a3, MooseClient as a4, type Blocks as a5, ClickHouseEngines as a6, dropView as a7, createMaterializedView as a8, populateTable as a9, QueryClient as aa, WorkflowClient as ab, getTemporalClient as ac, ApiHelpers as ad, ConsumptionHelpers as ae, joinQueries as af, type ConsumerConfig as ag, type TransformConfig as ah, type TaskContext as ai, type TaskConfig as aj, type IngestPipelineConfig as ak, type MaterializedViewConfig as al, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
2158
+ export { toQuery as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, type ApiUtil as K, LifeCycle as L, MaterializedView as M, type ConsumptionUtil as N, OlapTable as O, quoteIdentifier as P, type IdentifierBrandedString as Q, type NonIdentifierBrandedString as R, type SimpleAggregated as S, Task as T, type Value as U, View as V, Workflow as W, type RawValue as X, sql as Y, Sql as Z, toStaticQuery as _, type OlapConfig as a, toQueryPreview as a0, getValueFromParameter as a1, createClickhouseParameter as a2, mapToClickHouseType as a3, type MooseUtils as a4, MooseClient as a5, type Blocks as a6, ClickHouseEngines as a7, dropView as a8, createMaterializedView as a9, populateTable as aa, QueryClient as ab, WorkflowClient as ac, getTemporalClient as ad, ApiHelpers as ae, ConsumptionHelpers as af, joinQueries as ag, type ConsumerConfig as ah, type TransformConfig as ai, type TaskContext as aj, type TaskConfig as ak, type IngestPipelineConfig as al, type MaterializedViewConfig as am, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
@@ -1566,13 +1566,24 @@ declare class IngestApi<T> extends TypedBase<T, IngestConfig<T>> {
1566
1566
  constructor(name: string, config: IngestConfig<T>, schema: IJsonSchemaCollection$1.IV3_1, columns: Column[], validators: undefined, allowExtraFields: boolean);
1567
1567
  }
1568
1568
 
1569
- interface ApiUtil {
1569
+ /**
1570
+ * Utilities provided by getMooseUtils() for database access and SQL queries.
1571
+ * Works in both Moose runtime and standalone contexts.
1572
+ */
1573
+ interface MooseUtils {
1570
1574
  client: MooseClient;
1571
1575
  sql: typeof sql;
1572
- jwt: JWTPayload | undefined;
1576
+ jwt?: JWTPayload;
1573
1577
  }
1574
- /** @deprecated Use ApiUtil instead. */
1575
- type ConsumptionUtil = ApiUtil;
1578
+ /**
1579
+ * @deprecated Use MooseUtils instead. ApiUtil is now a type alias to MooseUtils
1580
+ * and will be removed in a future version.
1581
+ *
1582
+ * Migration: Replace `ApiUtil` with `MooseUtils` in your type annotations.
1583
+ */
1584
+ type ApiUtil = MooseUtils;
1585
+ /** @deprecated Use MooseUtils instead. */
1586
+ type ConsumptionUtil = MooseUtils;
1576
1587
  declare class MooseClient {
1577
1588
  query: QueryClient;
1578
1589
  workflow: WorkflowClient;
@@ -2144,4 +2155,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
2144
2155
  _argType?: ArgType;
2145
2156
  };
2146
2157
 
2147
- export { toQuery as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, type ApiUtil as K, LifeCycle as L, MaterializedView as M, type ConsumptionUtil as N, OlapTable as O, quoteIdentifier as P, type IdentifierBrandedString as Q, type NonIdentifierBrandedString as R, type SimpleAggregated as S, Task as T, type Value as U, View as V, Workflow as W, type RawValue as X, sql as Y, Sql as Z, toStaticQuery as _, type OlapConfig as a, toQueryPreview as a0, getValueFromParameter as a1, createClickhouseParameter as a2, mapToClickHouseType as a3, MooseClient as a4, type Blocks as a5, ClickHouseEngines as a6, dropView as a7, createMaterializedView as a8, populateTable as a9, QueryClient as aa, WorkflowClient as ab, getTemporalClient as ac, ApiHelpers as ad, ConsumptionHelpers as ae, joinQueries as af, type ConsumerConfig as ag, type TransformConfig as ah, type TaskContext as ai, type TaskConfig as aj, type IngestPipelineConfig as ak, type MaterializedViewConfig as al, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
2158
+ export { toQuery as $, type Aggregated as A, getWorkflows as B, ConsumptionApi as C, type DeadLetterModel as D, type EgressConfig as E, type FrameworkApp as F, getWorkflow as G, getWebApps as H, IngestApi as I, getWebApp as J, type ApiUtil as K, LifeCycle as L, MaterializedView as M, type ConsumptionUtil as N, OlapTable as O, quoteIdentifier as P, type IdentifierBrandedString as Q, type NonIdentifierBrandedString as R, type SimpleAggregated as S, Task as T, type Value as U, View as V, Workflow as W, type RawValue as X, sql as Y, Sql as Z, toStaticQuery as _, type OlapConfig as a, toQueryPreview as a0, getValueFromParameter as a1, createClickhouseParameter as a2, mapToClickHouseType as a3, type MooseUtils as a4, MooseClient as a5, type Blocks as a6, ClickHouseEngines as a7, dropView as a8, createMaterializedView as a9, populateTable as aa, QueryClient as ab, WorkflowClient as ac, getTemporalClient as ad, ApiHelpers as ae, ConsumptionHelpers as af, joinQueries as ag, type ConsumerConfig as ah, type TransformConfig as ai, type TaskContext as aj, type TaskConfig as ak, type IngestPipelineConfig as al, type MaterializedViewConfig as am, type S3QueueTableSettings as b, Stream as c, type StreamConfig as d, type DeadLetter as e, DeadLetterQueue as f, type IngestConfig as g, Api as h, type ApiConfig as i, IngestPipeline as j, SqlResource as k, ETLPipeline as l, type ETLPipelineConfig as m, WebApp as n, type WebAppConfig as o, type WebAppHandler as p, getTables as q, getTable as r, getStreams as s, getStream as t, getIngestApis as u, getIngestApi as v, getApis as w, getApi as x, getSqlResources as y, getSqlResource as z };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-ChWHzgtb.mjs';
2
- import { K as ApiUtil, a4 as MooseClient } from './index-rQOQo9sv.mjs';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ad as ApiHelpers, a5 as Blocks, a6 as ClickHouseEngines, C as ConsumptionApi, ae as ConsumptionHelpers, N as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Q as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, R as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, aa as QueryClient, X as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, Z as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, U as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ab as WorkflowClient, a2 as createClickhouseParameter, a8 as createMaterializedView, a7 as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ac as getTemporalClient, a1 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, af as joinQueries, a3 as mapToClickHouseType, a9 as populateTable, P as quoteIdentifier, Y as sql, $ as toQuery, a0 as toQueryPreview, _ as toStaticQuery } from './index-rQOQo9sv.mjs';
1
+ export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-FzU17dxm.mjs';
2
+ import { a4 as MooseUtils, K as ApiUtil, a5 as MooseClient } from './index-CcHF2cVT.mjs';
3
+ export { A as Aggregated, h as Api, i as ApiConfig, ae as ApiHelpers, a6 as Blocks, a7 as ClickHouseEngines, C as ConsumptionApi, af as ConsumptionHelpers, N as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Q as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, R as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, ab as QueryClient, X as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, Z as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, U as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ac as WorkflowClient, a2 as createClickhouseParameter, a9 as createMaterializedView, a8 as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ad as getTemporalClient, a1 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ag as joinQueries, a3 as mapToClickHouseType, aa as populateTable, P as quoteIdentifier, Y as sql, $ as toQuery, a0 as toQueryPreview, _ as toStaticQuery } from './index-CcHF2cVT.mjs';
4
4
  import * as _clickhouse_client from '@clickhouse/client';
5
5
  import { KafkaJS } from '@514labs/kafka-javascript';
6
6
  import http from 'http';
@@ -193,10 +193,51 @@ declare const mooseEnvSecrets: {
193
193
  get(envVarName: string): string;
194
194
  };
195
195
 
196
- declare function getMooseUtils(req: http.IncomingMessage | any): ApiUtil | undefined;
196
+ /**
197
+ * @deprecated Use `getMooseUtils()` from '@514labs/moose-lib' instead.
198
+ *
199
+ * This synchronous function extracts MooseUtils from a request object that was
200
+ * injected by Moose runtime middleware. It returns undefined if not running
201
+ * in a Moose-managed context.
202
+ *
203
+ * Migration: Replace with the async version:
204
+ * ```typescript
205
+ * // Old (sync, deprecated):
206
+ * import { getMooseUtilsFromRequest } from '@514labs/moose-lib';
207
+ * const moose = getMooseUtilsFromRequest(req);
208
+ *
209
+ * // New (async, recommended):
210
+ * import { getMooseUtils } from '@514labs/moose-lib';
211
+ * const moose = await getMooseUtils();
212
+ * ```
213
+ *
214
+ * @param req - The HTTP request object containing injected moose utilities
215
+ * @returns MooseUtils if available on the request, undefined otherwise
216
+ */
217
+ declare function getMooseUtilsFromRequest(req: http.IncomingMessage | any): MooseUtils | undefined;
218
+ /**
219
+ * @deprecated Use `getMooseUtils()` from '@514labs/moose-lib' instead.
220
+ *
221
+ * This is a legacy alias for getMooseUtilsFromRequest. The main getMooseUtils
222
+ * export from '@514labs/moose-lib' is now async and does not require a request parameter.
223
+ *
224
+ * BREAKING CHANGE WARNING: The new getMooseUtils() returns Promise<MooseUtils>,
225
+ * not MooseUtils | undefined. You must await the result:
226
+ * ```typescript
227
+ * const moose = await getMooseUtils(); // New async API
228
+ * ```
229
+ */
230
+ declare const getLegacyMooseUtils: typeof getMooseUtilsFromRequest;
231
+ /**
232
+ * @deprecated No longer needed. Use getMooseUtils() directly instead.
233
+ * Moose now handles utility injection automatically when injectMooseUtils is true.
234
+ */
197
235
  declare function expressMiddleware(): (req: any, res: any, next: any) => void;
236
+ /**
237
+ * @deprecated Use MooseUtils from helpers.ts instead.
238
+ */
198
239
  interface ExpressRequestWithMoose {
199
- moose?: ApiUtil;
240
+ moose?: MooseUtils;
200
241
  }
201
242
 
202
243
  interface TaskFunction {
@@ -322,6 +363,35 @@ interface RuntimeClickHouseConfig {
322
363
  useSSL: boolean;
323
364
  }
324
365
 
366
+ /**
367
+ * Get Moose utilities for database access and SQL queries.
368
+ * Works in both Moose runtime and standalone contexts.
369
+ *
370
+ * **IMPORTANT**: This function is async and returns a Promise. You must await the result:
371
+ * ```typescript
372
+ * const moose = await getMooseUtils(); // Correct
373
+ * const moose = getMooseUtils(); // WRONG - returns Promise, not MooseUtils!
374
+ * ```
375
+ *
376
+ * **Breaking Change from v1.x**: This function signature changed from sync to async.
377
+ * If you were using the old sync API that extracted utils from a request object,
378
+ * use `getMooseUtilsFromRequest(req)` for backward compatibility (deprecated).
379
+ *
380
+ * @param req - DEPRECATED: Request parameter is no longer needed and will be ignored.
381
+ * If you need to extract moose from a request, use getMooseUtilsFromRequest().
382
+ * @returns Promise resolving to MooseUtils with client and sql utilities.
383
+ *
384
+ * @example
385
+ * ```typescript
386
+ * const { client, sql } = await getMooseUtils();
387
+ * const result = await client.query.execute(sql`SELECT * FROM table`);
388
+ * ```
389
+ */
390
+ declare function getMooseUtils(req?: any): Promise<MooseUtils>;
391
+ /**
392
+ * @deprecated Use getMooseUtils() instead.
393
+ * Creates a Moose client for database access.
394
+ */
325
395
  declare function getMooseClients(config?: Partial<RuntimeClickHouseConfig>): Promise<{
326
396
  client: MooseClient;
327
397
  }>;
@@ -554,4 +624,4 @@ type DataModelConfig<T> = Partial<{
554
624
  parallelism?: number;
555
625
  }>;
556
626
 
557
- export { ACKs, ApiUtil, type CSVParsingConfig, CSV_DELIMITERS, type CliLogData, DEFAULT_CSV_CONFIG, DEFAULT_JSON_CONFIG, type DataModelConfig, DataSource, type DataSourceConfig, type ExpressRequestWithMoose, type ExtractionResult, type JSONParsingConfig, type KafkaClientConfig, type Logger, MAX_RETRIES, MAX_RETRIES_PRODUCER, MAX_RETRY_TIME_MS, MOOSE_RUNTIME_ENV_PREFIX, MooseCache, MooseClient, type Producer, RETRY_FACTOR_PRODUCER, RETRY_INITIAL_TIME_MS, type StripDateIntersection, type TaskConfig, type TaskDefinition, type TaskFunction, antiCachePath, cliLog, compilerLog, createApi, createConsumptionApi, createProducerConfig, expressMiddleware, getClickhouseClient, getFileName, getKafkaClient, getKafkaProducer, getMooseClients, getMooseUtils, isValidCSVDelimiter, logError, mapTstoJs, mooseEnvSecrets, mooseRuntimeEnv, parseCSV, parseJSON, parseJSONWithDates };
627
+ export { ACKs, ApiUtil, type CSVParsingConfig, CSV_DELIMITERS, type CliLogData, DEFAULT_CSV_CONFIG, DEFAULT_JSON_CONFIG, type DataModelConfig, DataSource, type DataSourceConfig, type ExpressRequestWithMoose, type ExtractionResult, type JSONParsingConfig, type KafkaClientConfig, type Logger, MAX_RETRIES, MAX_RETRIES_PRODUCER, MAX_RETRY_TIME_MS, MOOSE_RUNTIME_ENV_PREFIX, MooseCache, MooseClient, MooseUtils, type Producer, RETRY_FACTOR_PRODUCER, RETRY_INITIAL_TIME_MS, type StripDateIntersection, type TaskConfig, type TaskDefinition, type TaskFunction, antiCachePath, cliLog, compilerLog, createApi, createConsumptionApi, createProducerConfig, expressMiddleware, getClickhouseClient, getFileName, getKafkaClient, getKafkaProducer, getLegacyMooseUtils, getMooseClients, getMooseUtils, getMooseUtilsFromRequest, isValidCSVDelimiter, logError, mapTstoJs, mooseEnvSecrets, mooseRuntimeEnv, parseCSV, parseJSON, parseJSONWithDates };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-B8CAYjv5.js';
2
- import { K as ApiUtil, a4 as MooseClient } from './index-rQOQo9sv.js';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ad as ApiHelpers, a5 as Blocks, a6 as ClickHouseEngines, C as ConsumptionApi, ae as ConsumptionHelpers, N as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Q as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, R as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, aa as QueryClient, X as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, Z as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, U as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ab as WorkflowClient, a2 as createClickhouseParameter, a8 as createMaterializedView, a7 as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ac as getTemporalClient, a1 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, af as joinQueries, a3 as mapToClickHouseType, a9 as populateTable, P as quoteIdentifier, Y as sql, $ as toQuery, a0 as toQueryPreview, _ as toStaticQuery } from './index-rQOQo9sv.js';
1
+ export { C as ClickHouseByteSize, q as ClickHouseCodec, j as ClickHouseDecimal, n as ClickHouseDefault, k as ClickHouseFixedStringSize, l as ClickHouseFloat, a as ClickHouseInt, m as ClickHouseJson, e as ClickHouseLineString, p as ClickHouseMaterialized, f as ClickHouseMultiLineString, h as ClickHouseMultiPolygon, b as ClickHouseNamedTuple, c as ClickHousePoint, g as ClickHousePolygon, i as ClickHousePrecision, d as ClickHouseRing, o as ClickHouseTTL, D as DateTime, r as DateTime64, t as DateTime64String, s as DateTimeString, E as Decimal, F as FixedString, u as Float32, v as Float64, w as Int16, x as Int32, y as Int64, I as Int8, J as JWT, K as Key, L as LowCardinality, z as UInt16, A as UInt32, B as UInt64, U as UInt8, W as WithDefault } from './browserCompatible-CMEunMFq.js';
2
+ import { a4 as MooseUtils, K as ApiUtil, a5 as MooseClient } from './index-CcHF2cVT.js';
3
+ export { A as Aggregated, h as Api, i as ApiConfig, ae as ApiHelpers, a6 as Blocks, a7 as ClickHouseEngines, C as ConsumptionApi, af as ConsumptionHelpers, N as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Q as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, R as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, ab as QueryClient, X as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, Z as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, U as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ac as WorkflowClient, a2 as createClickhouseParameter, a9 as createMaterializedView, a8 as dropView, x as getApi, w as getApis, v as getIngestApi, u as getIngestApis, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ad as getTemporalClient, a1 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ag as joinQueries, a3 as mapToClickHouseType, aa as populateTable, P as quoteIdentifier, Y as sql, $ as toQuery, a0 as toQueryPreview, _ as toStaticQuery } from './index-CcHF2cVT.js';
4
4
  import * as _clickhouse_client from '@clickhouse/client';
5
5
  import { KafkaJS } from '@514labs/kafka-javascript';
6
6
  import http from 'http';
@@ -193,10 +193,51 @@ declare const mooseEnvSecrets: {
193
193
  get(envVarName: string): string;
194
194
  };
195
195
 
196
- declare function getMooseUtils(req: http.IncomingMessage | any): ApiUtil | undefined;
196
+ /**
197
+ * @deprecated Use `getMooseUtils()` from '@514labs/moose-lib' instead.
198
+ *
199
+ * This synchronous function extracts MooseUtils from a request object that was
200
+ * injected by Moose runtime middleware. It returns undefined if not running
201
+ * in a Moose-managed context.
202
+ *
203
+ * Migration: Replace with the async version:
204
+ * ```typescript
205
+ * // Old (sync, deprecated):
206
+ * import { getMooseUtilsFromRequest } from '@514labs/moose-lib';
207
+ * const moose = getMooseUtilsFromRequest(req);
208
+ *
209
+ * // New (async, recommended):
210
+ * import { getMooseUtils } from '@514labs/moose-lib';
211
+ * const moose = await getMooseUtils();
212
+ * ```
213
+ *
214
+ * @param req - The HTTP request object containing injected moose utilities
215
+ * @returns MooseUtils if available on the request, undefined otherwise
216
+ */
217
+ declare function getMooseUtilsFromRequest(req: http.IncomingMessage | any): MooseUtils | undefined;
218
+ /**
219
+ * @deprecated Use `getMooseUtils()` from '@514labs/moose-lib' instead.
220
+ *
221
+ * This is a legacy alias for getMooseUtilsFromRequest. The main getMooseUtils
222
+ * export from '@514labs/moose-lib' is now async and does not require a request parameter.
223
+ *
224
+ * BREAKING CHANGE WARNING: The new getMooseUtils() returns Promise<MooseUtils>,
225
+ * not MooseUtils | undefined. You must await the result:
226
+ * ```typescript
227
+ * const moose = await getMooseUtils(); // New async API
228
+ * ```
229
+ */
230
+ declare const getLegacyMooseUtils: typeof getMooseUtilsFromRequest;
231
+ /**
232
+ * @deprecated No longer needed. Use getMooseUtils() directly instead.
233
+ * Moose now handles utility injection automatically when injectMooseUtils is true.
234
+ */
197
235
  declare function expressMiddleware(): (req: any, res: any, next: any) => void;
236
+ /**
237
+ * @deprecated Use MooseUtils from helpers.ts instead.
238
+ */
198
239
  interface ExpressRequestWithMoose {
199
- moose?: ApiUtil;
240
+ moose?: MooseUtils;
200
241
  }
201
242
 
202
243
  interface TaskFunction {
@@ -322,6 +363,35 @@ interface RuntimeClickHouseConfig {
322
363
  useSSL: boolean;
323
364
  }
324
365
 
366
+ /**
367
+ * Get Moose utilities for database access and SQL queries.
368
+ * Works in both Moose runtime and standalone contexts.
369
+ *
370
+ * **IMPORTANT**: This function is async and returns a Promise. You must await the result:
371
+ * ```typescript
372
+ * const moose = await getMooseUtils(); // Correct
373
+ * const moose = getMooseUtils(); // WRONG - returns Promise, not MooseUtils!
374
+ * ```
375
+ *
376
+ * **Breaking Change from v1.x**: This function signature changed from sync to async.
377
+ * If you were using the old sync API that extracted utils from a request object,
378
+ * use `getMooseUtilsFromRequest(req)` for backward compatibility (deprecated).
379
+ *
380
+ * @param req - DEPRECATED: Request parameter is no longer needed and will be ignored.
381
+ * If you need to extract moose from a request, use getMooseUtilsFromRequest().
382
+ * @returns Promise resolving to MooseUtils with client and sql utilities.
383
+ *
384
+ * @example
385
+ * ```typescript
386
+ * const { client, sql } = await getMooseUtils();
387
+ * const result = await client.query.execute(sql`SELECT * FROM table`);
388
+ * ```
389
+ */
390
+ declare function getMooseUtils(req?: any): Promise<MooseUtils>;
391
+ /**
392
+ * @deprecated Use getMooseUtils() instead.
393
+ * Creates a Moose client for database access.
394
+ */
325
395
  declare function getMooseClients(config?: Partial<RuntimeClickHouseConfig>): Promise<{
326
396
  client: MooseClient;
327
397
  }>;
@@ -554,4 +624,4 @@ type DataModelConfig<T> = Partial<{
554
624
  parallelism?: number;
555
625
  }>;
556
626
 
557
- export { ACKs, ApiUtil, type CSVParsingConfig, CSV_DELIMITERS, type CliLogData, DEFAULT_CSV_CONFIG, DEFAULT_JSON_CONFIG, type DataModelConfig, DataSource, type DataSourceConfig, type ExpressRequestWithMoose, type ExtractionResult, type JSONParsingConfig, type KafkaClientConfig, type Logger, MAX_RETRIES, MAX_RETRIES_PRODUCER, MAX_RETRY_TIME_MS, MOOSE_RUNTIME_ENV_PREFIX, MooseCache, MooseClient, type Producer, RETRY_FACTOR_PRODUCER, RETRY_INITIAL_TIME_MS, type StripDateIntersection, type TaskConfig, type TaskDefinition, type TaskFunction, antiCachePath, cliLog, compilerLog, createApi, createConsumptionApi, createProducerConfig, expressMiddleware, getClickhouseClient, getFileName, getKafkaClient, getKafkaProducer, getMooseClients, getMooseUtils, isValidCSVDelimiter, logError, mapTstoJs, mooseEnvSecrets, mooseRuntimeEnv, parseCSV, parseJSON, parseJSONWithDates };
627
+ export { ACKs, ApiUtil, type CSVParsingConfig, CSV_DELIMITERS, type CliLogData, DEFAULT_CSV_CONFIG, DEFAULT_JSON_CONFIG, type DataModelConfig, DataSource, type DataSourceConfig, type ExpressRequestWithMoose, type ExtractionResult, type JSONParsingConfig, type KafkaClientConfig, type Logger, MAX_RETRIES, MAX_RETRIES_PRODUCER, MAX_RETRY_TIME_MS, MOOSE_RUNTIME_ENV_PREFIX, MooseCache, MooseClient, MooseUtils, type Producer, RETRY_FACTOR_PRODUCER, RETRY_INITIAL_TIME_MS, type StripDateIntersection, type TaskConfig, type TaskDefinition, type TaskFunction, antiCachePath, cliLog, compilerLog, createApi, createConsumptionApi, createProducerConfig, expressMiddleware, getClickhouseClient, getFileName, getKafkaClient, getKafkaProducer, getLegacyMooseUtils, getMooseClients, getMooseUtils, getMooseUtilsFromRequest, isValidCSVDelimiter, logError, mapTstoJs, mooseEnvSecrets, mooseRuntimeEnv, parseCSV, parseJSON, parseJSONWithDates };