@514labs/moose-lib 0.6.295-ci-18-g185e40dc → 0.6.295-ci-16-gad4ec11a
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.
- package/dist/{browserCompatible-DhVPp9qX.d.ts → browserCompatible-CMEunMFq.d.ts} +1 -1
- package/dist/{browserCompatible-DCCiBirg.d.mts → browserCompatible-FzU17dxm.d.mts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +2445 -2186
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +2392 -2131
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/dmv2/index.d.mts +1 -1
- package/dist/dmv2/index.d.ts +1 -1
- package/dist/dmv2/index.js +2341 -2082
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +2302 -2041
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-CcZRaA0b.d.mts → index-CcHF2cVT.d.mts} +56 -87
- package/dist/{index-CcZRaA0b.d.ts → index-CcHF2cVT.d.ts} +56 -87
- package/dist/index.d.mts +79 -6
- package/dist/index.d.ts +79 -6
- package/dist/index.js +3070 -2758
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2968 -2653
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +1712 -1159
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +1705 -1154
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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
|
|
1576
|
+
jwt?: JWTPayload;
|
|
1573
1577
|
}
|
|
1574
|
-
/**
|
|
1575
|
-
type
|
|
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;
|
|
@@ -1883,21 +1894,50 @@ declare class ETLPipeline<T, U> {
|
|
|
1883
1894
|
run(): Promise<void>;
|
|
1884
1895
|
}
|
|
1885
1896
|
|
|
1897
|
+
type SqlObject = OlapTable<any> | SqlResource;
|
|
1886
1898
|
/**
|
|
1887
|
-
* Represents a
|
|
1888
|
-
*
|
|
1899
|
+
* Represents a generic SQL resource that requires setup and teardown commands.
|
|
1900
|
+
* Base class for constructs like Views and Materialized Views. Tracks dependencies.
|
|
1889
1901
|
*/
|
|
1890
|
-
declare class
|
|
1902
|
+
declare class SqlResource {
|
|
1891
1903
|
/** @internal */
|
|
1892
|
-
readonly kind = "
|
|
1893
|
-
/**
|
|
1904
|
+
readonly kind = "SqlResource";
|
|
1905
|
+
/** Array of SQL statements to execute for setting up the resource. */
|
|
1906
|
+
setup: readonly string[];
|
|
1907
|
+
/** Array of SQL statements to execute for tearing down the resource. */
|
|
1908
|
+
teardown: readonly string[];
|
|
1909
|
+
/** The name of the SQL resource (e.g., view name, materialized view name). */
|
|
1894
1910
|
name: string;
|
|
1895
|
-
/**
|
|
1896
|
-
|
|
1897
|
-
/**
|
|
1898
|
-
|
|
1899
|
-
/** @internal Source file path where this
|
|
1911
|
+
/** List of OlapTables or Views that this resource reads data from. */
|
|
1912
|
+
pullsDataFrom: SqlObject[];
|
|
1913
|
+
/** List of OlapTables or Views that this resource writes data to. */
|
|
1914
|
+
pushesDataTo: SqlObject[];
|
|
1915
|
+
/** @internal Source file path where this resource was defined */
|
|
1900
1916
|
sourceFile?: string;
|
|
1917
|
+
/** @internal Source line number where this resource was defined */
|
|
1918
|
+
sourceLine?: number;
|
|
1919
|
+
/** @internal Source column number where this resource was defined */
|
|
1920
|
+
sourceColumn?: number;
|
|
1921
|
+
/**
|
|
1922
|
+
* Creates a new SqlResource instance.
|
|
1923
|
+
* @param name The name of the resource.
|
|
1924
|
+
* @param setup An array of SQL DDL statements to create the resource.
|
|
1925
|
+
* @param teardown An array of SQL DDL statements to drop the resource.
|
|
1926
|
+
* @param options Optional configuration for specifying data dependencies.
|
|
1927
|
+
* @param options.pullsDataFrom Tables/Views this resource reads from.
|
|
1928
|
+
* @param options.pushesDataTo Tables/Views this resource writes to.
|
|
1929
|
+
*/
|
|
1930
|
+
constructor(name: string, setup: readonly (string | Sql)[], teardown: readonly (string | Sql)[], options?: {
|
|
1931
|
+
pullsDataFrom?: SqlObject[];
|
|
1932
|
+
pushesDataTo?: SqlObject[];
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* Represents a database View, defined by a SQL SELECT statement based on one or more base tables or other views.
|
|
1938
|
+
* Inherits from SqlResource, providing setup (CREATE VIEW) and teardown (DROP VIEW) commands.
|
|
1939
|
+
*/
|
|
1940
|
+
declare class View extends SqlResource {
|
|
1901
1941
|
/**
|
|
1902
1942
|
* Creates a new View instance.
|
|
1903
1943
|
* @param name The name of the view to be created.
|
|
@@ -1943,19 +1983,9 @@ interface MaterializedViewConfig<T> {
|
|
|
1943
1983
|
*
|
|
1944
1984
|
* @template TargetTable The data type of the records stored in the underlying target OlapTable. The structure of T defines the target table schema.
|
|
1945
1985
|
*/
|
|
1946
|
-
declare class MaterializedView<TargetTable> {
|
|
1947
|
-
/** @internal */
|
|
1948
|
-
readonly kind = "MaterializedView";
|
|
1949
|
-
/** The name of the materialized view */
|
|
1950
|
-
name: string;
|
|
1986
|
+
declare class MaterializedView<TargetTable> extends SqlResource {
|
|
1951
1987
|
/** The target OlapTable instance where the materialized data is stored. */
|
|
1952
1988
|
targetTable: OlapTable<TargetTable>;
|
|
1953
|
-
/** The SELECT SQL statement */
|
|
1954
|
-
selectSql: string;
|
|
1955
|
-
/** Names of source tables that the SELECT reads from */
|
|
1956
|
-
sourceTables: string[];
|
|
1957
|
-
/** @internal Source file path where this MV was defined */
|
|
1958
|
-
sourceFile?: string;
|
|
1959
1989
|
/**
|
|
1960
1990
|
* Creates a new MaterializedView instance.
|
|
1961
1991
|
* Requires the `TargetTable` type parameter to be explicitly provided or inferred,
|
|
@@ -1968,45 +1998,6 @@ declare class MaterializedView<TargetTable> {
|
|
|
1968
1998
|
constructor(options: MaterializedViewConfig<TargetTable>, targetSchema: IJsonSchemaCollection$1.IV3_1, targetColumns: Column[]);
|
|
1969
1999
|
}
|
|
1970
2000
|
|
|
1971
|
-
type SqlObject = OlapTable<any> | SqlResource;
|
|
1972
|
-
/**
|
|
1973
|
-
* Represents a generic SQL resource that requires setup and teardown commands.
|
|
1974
|
-
* Base class for constructs like Views and Materialized Views. Tracks dependencies.
|
|
1975
|
-
*/
|
|
1976
|
-
declare class SqlResource {
|
|
1977
|
-
/** @internal */
|
|
1978
|
-
readonly kind = "SqlResource";
|
|
1979
|
-
/** Array of SQL statements to execute for setting up the resource. */
|
|
1980
|
-
setup: readonly string[];
|
|
1981
|
-
/** Array of SQL statements to execute for tearing down the resource. */
|
|
1982
|
-
teardown: readonly string[];
|
|
1983
|
-
/** The name of the SQL resource (e.g., view name, materialized view name). */
|
|
1984
|
-
name: string;
|
|
1985
|
-
/** List of OlapTables or Views that this resource reads data from. */
|
|
1986
|
-
pullsDataFrom: SqlObject[];
|
|
1987
|
-
/** List of OlapTables or Views that this resource writes data to. */
|
|
1988
|
-
pushesDataTo: SqlObject[];
|
|
1989
|
-
/** @internal Source file path where this resource was defined */
|
|
1990
|
-
sourceFile?: string;
|
|
1991
|
-
/** @internal Source line number where this resource was defined */
|
|
1992
|
-
sourceLine?: number;
|
|
1993
|
-
/** @internal Source column number where this resource was defined */
|
|
1994
|
-
sourceColumn?: number;
|
|
1995
|
-
/**
|
|
1996
|
-
* Creates a new SqlResource instance.
|
|
1997
|
-
* @param name The name of the resource.
|
|
1998
|
-
* @param setup An array of SQL DDL statements to create the resource.
|
|
1999
|
-
* @param teardown An array of SQL DDL statements to drop the resource.
|
|
2000
|
-
* @param options Optional configuration for specifying data dependencies.
|
|
2001
|
-
* @param options.pullsDataFrom Tables/Views this resource reads from.
|
|
2002
|
-
* @param options.pushesDataTo Tables/Views this resource writes to.
|
|
2003
|
-
*/
|
|
2004
|
-
constructor(name: string, setup: readonly (string | Sql)[], teardown: readonly (string | Sql)[], options?: {
|
|
2005
|
-
pullsDataFrom?: SqlObject[];
|
|
2006
|
-
pushesDataTo?: SqlObject[];
|
|
2007
|
-
});
|
|
2008
|
-
}
|
|
2009
|
-
|
|
2010
2001
|
type WebAppHandler = (req: http.IncomingMessage, res: http.ServerResponse) => void | Promise<void>;
|
|
2011
2002
|
interface FrameworkApp {
|
|
2012
2003
|
handle?: (req: http.IncomingMessage, res: http.ServerResponse, next?: (err?: any) => void) => void;
|
|
@@ -2123,28 +2114,6 @@ declare function getWebApps(): Map<string, WebApp>;
|
|
|
2123
2114
|
* @returns The WebApp instance or undefined if not found
|
|
2124
2115
|
*/
|
|
2125
2116
|
declare function getWebApp(name: string): WebApp | undefined;
|
|
2126
|
-
/**
|
|
2127
|
-
* Get all registered materialized views.
|
|
2128
|
-
* @returns A Map of MV name to MaterializedView instance
|
|
2129
|
-
*/
|
|
2130
|
-
declare function getMaterializedViews(): Map<string, MaterializedView<any>>;
|
|
2131
|
-
/**
|
|
2132
|
-
* Get a registered materialized view by name.
|
|
2133
|
-
* @param name - The name of the materialized view
|
|
2134
|
-
* @returns The MaterializedView instance or undefined if not found
|
|
2135
|
-
*/
|
|
2136
|
-
declare function getMaterializedView(name: string): MaterializedView<any> | undefined;
|
|
2137
|
-
/**
|
|
2138
|
-
* Get all registered custom views.
|
|
2139
|
-
* @returns A Map of view name to View instance
|
|
2140
|
-
*/
|
|
2141
|
-
declare function getCustomViews(): Map<string, View>;
|
|
2142
|
-
/**
|
|
2143
|
-
* Get a registered custom view by name.
|
|
2144
|
-
* @param name - The name of the custom view
|
|
2145
|
-
* @returns The View instance or undefined if not found
|
|
2146
|
-
*/
|
|
2147
|
-
declare function getCustomView(name: string): View | undefined;
|
|
2148
2117
|
|
|
2149
2118
|
/**
|
|
2150
2119
|
* @module dmv2
|
|
@@ -2186,4 +2155,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
|
|
|
2186
2155
|
_argType?: ArgType;
|
|
2187
2156
|
};
|
|
2188
2157
|
|
|
2189
|
-
export {
|
|
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
|
-
|
|
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
|
|
1576
|
+
jwt?: JWTPayload;
|
|
1573
1577
|
}
|
|
1574
|
-
/**
|
|
1575
|
-
type
|
|
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;
|
|
@@ -1883,21 +1894,50 @@ declare class ETLPipeline<T, U> {
|
|
|
1883
1894
|
run(): Promise<void>;
|
|
1884
1895
|
}
|
|
1885
1896
|
|
|
1897
|
+
type SqlObject = OlapTable<any> | SqlResource;
|
|
1886
1898
|
/**
|
|
1887
|
-
* Represents a
|
|
1888
|
-
*
|
|
1899
|
+
* Represents a generic SQL resource that requires setup and teardown commands.
|
|
1900
|
+
* Base class for constructs like Views and Materialized Views. Tracks dependencies.
|
|
1889
1901
|
*/
|
|
1890
|
-
declare class
|
|
1902
|
+
declare class SqlResource {
|
|
1891
1903
|
/** @internal */
|
|
1892
|
-
readonly kind = "
|
|
1893
|
-
/**
|
|
1904
|
+
readonly kind = "SqlResource";
|
|
1905
|
+
/** Array of SQL statements to execute for setting up the resource. */
|
|
1906
|
+
setup: readonly string[];
|
|
1907
|
+
/** Array of SQL statements to execute for tearing down the resource. */
|
|
1908
|
+
teardown: readonly string[];
|
|
1909
|
+
/** The name of the SQL resource (e.g., view name, materialized view name). */
|
|
1894
1910
|
name: string;
|
|
1895
|
-
/**
|
|
1896
|
-
|
|
1897
|
-
/**
|
|
1898
|
-
|
|
1899
|
-
/** @internal Source file path where this
|
|
1911
|
+
/** List of OlapTables or Views that this resource reads data from. */
|
|
1912
|
+
pullsDataFrom: SqlObject[];
|
|
1913
|
+
/** List of OlapTables or Views that this resource writes data to. */
|
|
1914
|
+
pushesDataTo: SqlObject[];
|
|
1915
|
+
/** @internal Source file path where this resource was defined */
|
|
1900
1916
|
sourceFile?: string;
|
|
1917
|
+
/** @internal Source line number where this resource was defined */
|
|
1918
|
+
sourceLine?: number;
|
|
1919
|
+
/** @internal Source column number where this resource was defined */
|
|
1920
|
+
sourceColumn?: number;
|
|
1921
|
+
/**
|
|
1922
|
+
* Creates a new SqlResource instance.
|
|
1923
|
+
* @param name The name of the resource.
|
|
1924
|
+
* @param setup An array of SQL DDL statements to create the resource.
|
|
1925
|
+
* @param teardown An array of SQL DDL statements to drop the resource.
|
|
1926
|
+
* @param options Optional configuration for specifying data dependencies.
|
|
1927
|
+
* @param options.pullsDataFrom Tables/Views this resource reads from.
|
|
1928
|
+
* @param options.pushesDataTo Tables/Views this resource writes to.
|
|
1929
|
+
*/
|
|
1930
|
+
constructor(name: string, setup: readonly (string | Sql)[], teardown: readonly (string | Sql)[], options?: {
|
|
1931
|
+
pullsDataFrom?: SqlObject[];
|
|
1932
|
+
pushesDataTo?: SqlObject[];
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* Represents a database View, defined by a SQL SELECT statement based on one or more base tables or other views.
|
|
1938
|
+
* Inherits from SqlResource, providing setup (CREATE VIEW) and teardown (DROP VIEW) commands.
|
|
1939
|
+
*/
|
|
1940
|
+
declare class View extends SqlResource {
|
|
1901
1941
|
/**
|
|
1902
1942
|
* Creates a new View instance.
|
|
1903
1943
|
* @param name The name of the view to be created.
|
|
@@ -1943,19 +1983,9 @@ interface MaterializedViewConfig<T> {
|
|
|
1943
1983
|
*
|
|
1944
1984
|
* @template TargetTable The data type of the records stored in the underlying target OlapTable. The structure of T defines the target table schema.
|
|
1945
1985
|
*/
|
|
1946
|
-
declare class MaterializedView<TargetTable> {
|
|
1947
|
-
/** @internal */
|
|
1948
|
-
readonly kind = "MaterializedView";
|
|
1949
|
-
/** The name of the materialized view */
|
|
1950
|
-
name: string;
|
|
1986
|
+
declare class MaterializedView<TargetTable> extends SqlResource {
|
|
1951
1987
|
/** The target OlapTable instance where the materialized data is stored. */
|
|
1952
1988
|
targetTable: OlapTable<TargetTable>;
|
|
1953
|
-
/** The SELECT SQL statement */
|
|
1954
|
-
selectSql: string;
|
|
1955
|
-
/** Names of source tables that the SELECT reads from */
|
|
1956
|
-
sourceTables: string[];
|
|
1957
|
-
/** @internal Source file path where this MV was defined */
|
|
1958
|
-
sourceFile?: string;
|
|
1959
1989
|
/**
|
|
1960
1990
|
* Creates a new MaterializedView instance.
|
|
1961
1991
|
* Requires the `TargetTable` type parameter to be explicitly provided or inferred,
|
|
@@ -1968,45 +1998,6 @@ declare class MaterializedView<TargetTable> {
|
|
|
1968
1998
|
constructor(options: MaterializedViewConfig<TargetTable>, targetSchema: IJsonSchemaCollection$1.IV3_1, targetColumns: Column[]);
|
|
1969
1999
|
}
|
|
1970
2000
|
|
|
1971
|
-
type SqlObject = OlapTable<any> | SqlResource;
|
|
1972
|
-
/**
|
|
1973
|
-
* Represents a generic SQL resource that requires setup and teardown commands.
|
|
1974
|
-
* Base class for constructs like Views and Materialized Views. Tracks dependencies.
|
|
1975
|
-
*/
|
|
1976
|
-
declare class SqlResource {
|
|
1977
|
-
/** @internal */
|
|
1978
|
-
readonly kind = "SqlResource";
|
|
1979
|
-
/** Array of SQL statements to execute for setting up the resource. */
|
|
1980
|
-
setup: readonly string[];
|
|
1981
|
-
/** Array of SQL statements to execute for tearing down the resource. */
|
|
1982
|
-
teardown: readonly string[];
|
|
1983
|
-
/** The name of the SQL resource (e.g., view name, materialized view name). */
|
|
1984
|
-
name: string;
|
|
1985
|
-
/** List of OlapTables or Views that this resource reads data from. */
|
|
1986
|
-
pullsDataFrom: SqlObject[];
|
|
1987
|
-
/** List of OlapTables or Views that this resource writes data to. */
|
|
1988
|
-
pushesDataTo: SqlObject[];
|
|
1989
|
-
/** @internal Source file path where this resource was defined */
|
|
1990
|
-
sourceFile?: string;
|
|
1991
|
-
/** @internal Source line number where this resource was defined */
|
|
1992
|
-
sourceLine?: number;
|
|
1993
|
-
/** @internal Source column number where this resource was defined */
|
|
1994
|
-
sourceColumn?: number;
|
|
1995
|
-
/**
|
|
1996
|
-
* Creates a new SqlResource instance.
|
|
1997
|
-
* @param name The name of the resource.
|
|
1998
|
-
* @param setup An array of SQL DDL statements to create the resource.
|
|
1999
|
-
* @param teardown An array of SQL DDL statements to drop the resource.
|
|
2000
|
-
* @param options Optional configuration for specifying data dependencies.
|
|
2001
|
-
* @param options.pullsDataFrom Tables/Views this resource reads from.
|
|
2002
|
-
* @param options.pushesDataTo Tables/Views this resource writes to.
|
|
2003
|
-
*/
|
|
2004
|
-
constructor(name: string, setup: readonly (string | Sql)[], teardown: readonly (string | Sql)[], options?: {
|
|
2005
|
-
pullsDataFrom?: SqlObject[];
|
|
2006
|
-
pushesDataTo?: SqlObject[];
|
|
2007
|
-
});
|
|
2008
|
-
}
|
|
2009
|
-
|
|
2010
2001
|
type WebAppHandler = (req: http.IncomingMessage, res: http.ServerResponse) => void | Promise<void>;
|
|
2011
2002
|
interface FrameworkApp {
|
|
2012
2003
|
handle?: (req: http.IncomingMessage, res: http.ServerResponse, next?: (err?: any) => void) => void;
|
|
@@ -2123,28 +2114,6 @@ declare function getWebApps(): Map<string, WebApp>;
|
|
|
2123
2114
|
* @returns The WebApp instance or undefined if not found
|
|
2124
2115
|
*/
|
|
2125
2116
|
declare function getWebApp(name: string): WebApp | undefined;
|
|
2126
|
-
/**
|
|
2127
|
-
* Get all registered materialized views.
|
|
2128
|
-
* @returns A Map of MV name to MaterializedView instance
|
|
2129
|
-
*/
|
|
2130
|
-
declare function getMaterializedViews(): Map<string, MaterializedView<any>>;
|
|
2131
|
-
/**
|
|
2132
|
-
* Get a registered materialized view by name.
|
|
2133
|
-
* @param name - The name of the materialized view
|
|
2134
|
-
* @returns The MaterializedView instance or undefined if not found
|
|
2135
|
-
*/
|
|
2136
|
-
declare function getMaterializedView(name: string): MaterializedView<any> | undefined;
|
|
2137
|
-
/**
|
|
2138
|
-
* Get all registered custom views.
|
|
2139
|
-
* @returns A Map of view name to View instance
|
|
2140
|
-
*/
|
|
2141
|
-
declare function getCustomViews(): Map<string, View>;
|
|
2142
|
-
/**
|
|
2143
|
-
* Get a registered custom view by name.
|
|
2144
|
-
* @param name - The name of the custom view
|
|
2145
|
-
* @returns The View instance or undefined if not found
|
|
2146
|
-
*/
|
|
2147
|
-
declare function getCustomView(name: string): View | undefined;
|
|
2148
2117
|
|
|
2149
2118
|
/**
|
|
2150
2119
|
* @module dmv2
|
|
@@ -2186,4 +2155,4 @@ type SimpleAggregated<AggregationFunction extends string, ArgType = any> = {
|
|
|
2186
2155
|
_argType?: ArgType;
|
|
2187
2156
|
};
|
|
2188
2157
|
|
|
2189
|
-
export {
|
|
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-
|
|
2
|
-
import {
|
|
3
|
-
export { A as Aggregated, h as Api, i as ApiConfig,
|
|
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,54 @@ declare const mooseEnvSecrets: {
|
|
|
193
193
|
get(envVarName: string): string;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
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
|
+
* @param req - The HTTP request object containing injected moose utilities
|
|
231
|
+
* @returns MooseUtils if available on the request, undefined otherwise
|
|
232
|
+
*/
|
|
233
|
+
declare function getLegacyMooseUtils(req: http.IncomingMessage | any): MooseUtils | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* @deprecated No longer needed. Use getMooseUtils() directly instead.
|
|
236
|
+
* Moose now handles utility injection automatically when injectMooseUtils is true.
|
|
237
|
+
*/
|
|
197
238
|
declare function expressMiddleware(): (req: any, res: any, next: any) => void;
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated Use MooseUtils from helpers.ts instead.
|
|
241
|
+
*/
|
|
198
242
|
interface ExpressRequestWithMoose {
|
|
199
|
-
moose?:
|
|
243
|
+
moose?: MooseUtils;
|
|
200
244
|
}
|
|
201
245
|
|
|
202
246
|
interface TaskFunction {
|
|
@@ -322,6 +366,35 @@ interface RuntimeClickHouseConfig {
|
|
|
322
366
|
useSSL: boolean;
|
|
323
367
|
}
|
|
324
368
|
|
|
369
|
+
/**
|
|
370
|
+
* Get Moose utilities for database access and SQL queries.
|
|
371
|
+
* Works in both Moose runtime and standalone contexts.
|
|
372
|
+
*
|
|
373
|
+
* **IMPORTANT**: This function is async and returns a Promise. You must await the result:
|
|
374
|
+
* ```typescript
|
|
375
|
+
* const moose = await getMooseUtils(); // Correct
|
|
376
|
+
* const moose = getMooseUtils(); // WRONG - returns Promise, not MooseUtils!
|
|
377
|
+
* ```
|
|
378
|
+
*
|
|
379
|
+
* **Breaking Change from v1.x**: This function signature changed from sync to async.
|
|
380
|
+
* If you were using the old sync API that extracted utils from a request object,
|
|
381
|
+
* use `getMooseUtilsFromRequest(req)` for backward compatibility (deprecated).
|
|
382
|
+
*
|
|
383
|
+
* @param req - DEPRECATED: Request parameter is no longer needed and will be ignored.
|
|
384
|
+
* If you need to extract moose from a request, use getMooseUtilsFromRequest().
|
|
385
|
+
* @returns Promise resolving to MooseUtils with client and sql utilities.
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```typescript
|
|
389
|
+
* const { client, sql } = await getMooseUtils();
|
|
390
|
+
* const result = await client.query.execute(sql`SELECT * FROM table`);
|
|
391
|
+
* ```
|
|
392
|
+
*/
|
|
393
|
+
declare function getMooseUtils(req?: any): Promise<MooseUtils>;
|
|
394
|
+
/**
|
|
395
|
+
* @deprecated Use getMooseUtils() instead.
|
|
396
|
+
* Creates a Moose client for database access.
|
|
397
|
+
*/
|
|
325
398
|
declare function getMooseClients(config?: Partial<RuntimeClickHouseConfig>): Promise<{
|
|
326
399
|
client: MooseClient;
|
|
327
400
|
}>;
|
|
@@ -554,4 +627,4 @@ type DataModelConfig<T> = Partial<{
|
|
|
554
627
|
parallelism?: number;
|
|
555
628
|
}>;
|
|
556
629
|
|
|
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 };
|
|
630
|
+
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-
|
|
2
|
-
import {
|
|
3
|
-
export { A as Aggregated, h as Api, i as ApiConfig,
|
|
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,54 @@ declare const mooseEnvSecrets: {
|
|
|
193
193
|
get(envVarName: string): string;
|
|
194
194
|
};
|
|
195
195
|
|
|
196
|
-
|
|
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
|
+
* @param req - The HTTP request object containing injected moose utilities
|
|
231
|
+
* @returns MooseUtils if available on the request, undefined otherwise
|
|
232
|
+
*/
|
|
233
|
+
declare function getLegacyMooseUtils(req: http.IncomingMessage | any): MooseUtils | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* @deprecated No longer needed. Use getMooseUtils() directly instead.
|
|
236
|
+
* Moose now handles utility injection automatically when injectMooseUtils is true.
|
|
237
|
+
*/
|
|
197
238
|
declare function expressMiddleware(): (req: any, res: any, next: any) => void;
|
|
239
|
+
/**
|
|
240
|
+
* @deprecated Use MooseUtils from helpers.ts instead.
|
|
241
|
+
*/
|
|
198
242
|
interface ExpressRequestWithMoose {
|
|
199
|
-
moose?:
|
|
243
|
+
moose?: MooseUtils;
|
|
200
244
|
}
|
|
201
245
|
|
|
202
246
|
interface TaskFunction {
|
|
@@ -322,6 +366,35 @@ interface RuntimeClickHouseConfig {
|
|
|
322
366
|
useSSL: boolean;
|
|
323
367
|
}
|
|
324
368
|
|
|
369
|
+
/**
|
|
370
|
+
* Get Moose utilities for database access and SQL queries.
|
|
371
|
+
* Works in both Moose runtime and standalone contexts.
|
|
372
|
+
*
|
|
373
|
+
* **IMPORTANT**: This function is async and returns a Promise. You must await the result:
|
|
374
|
+
* ```typescript
|
|
375
|
+
* const moose = await getMooseUtils(); // Correct
|
|
376
|
+
* const moose = getMooseUtils(); // WRONG - returns Promise, not MooseUtils!
|
|
377
|
+
* ```
|
|
378
|
+
*
|
|
379
|
+
* **Breaking Change from v1.x**: This function signature changed from sync to async.
|
|
380
|
+
* If you were using the old sync API that extracted utils from a request object,
|
|
381
|
+
* use `getMooseUtilsFromRequest(req)` for backward compatibility (deprecated).
|
|
382
|
+
*
|
|
383
|
+
* @param req - DEPRECATED: Request parameter is no longer needed and will be ignored.
|
|
384
|
+
* If you need to extract moose from a request, use getMooseUtilsFromRequest().
|
|
385
|
+
* @returns Promise resolving to MooseUtils with client and sql utilities.
|
|
386
|
+
*
|
|
387
|
+
* @example
|
|
388
|
+
* ```typescript
|
|
389
|
+
* const { client, sql } = await getMooseUtils();
|
|
390
|
+
* const result = await client.query.execute(sql`SELECT * FROM table`);
|
|
391
|
+
* ```
|
|
392
|
+
*/
|
|
393
|
+
declare function getMooseUtils(req?: any): Promise<MooseUtils>;
|
|
394
|
+
/**
|
|
395
|
+
* @deprecated Use getMooseUtils() instead.
|
|
396
|
+
* Creates a Moose client for database access.
|
|
397
|
+
*/
|
|
325
398
|
declare function getMooseClients(config?: Partial<RuntimeClickHouseConfig>): Promise<{
|
|
326
399
|
client: MooseClient;
|
|
327
400
|
}>;
|
|
@@ -554,4 +627,4 @@ type DataModelConfig<T> = Partial<{
|
|
|
554
627
|
parallelism?: number;
|
|
555
628
|
}>;
|
|
556
629
|
|
|
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 };
|
|
630
|
+
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 };
|