@514labs/moose-lib 0.6.297-ci-22-g1be0de24 → 0.6.297-ci-23-g751e4221

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.
@@ -1907,15 +1907,20 @@ declare class View {
1907
1907
  selectSql: string;
1908
1908
  /** Names of source tables/views that the SELECT reads from */
1909
1909
  sourceTables: string[];
1910
- /** @internal Source file path where this view was defined */
1911
- sourceFile?: string;
1910
+ /** Optional metadata for the view */
1911
+ metadata: {
1912
+ [key: string]: any;
1913
+ };
1912
1914
  /**
1913
1915
  * Creates a new View instance.
1914
1916
  * @param name The name of the view to be created.
1915
1917
  * @param selectStatement The SQL SELECT statement that defines the view's logic.
1916
1918
  * @param baseTables An array of OlapTable or View objects that the `selectStatement` reads from. Used for dependency tracking.
1919
+ * @param metadata Optional metadata for the view (e.g., description, source file).
1917
1920
  */
1918
- constructor(name: string, selectStatement: string | Sql, baseTables: (OlapTable<any> | View)[]);
1921
+ constructor(name: string, selectStatement: string | Sql, baseTables: (OlapTable<any> | View)[], metadata?: {
1922
+ [key: string]: any;
1923
+ });
1919
1924
  }
1920
1925
 
1921
1926
  /**
@@ -1946,6 +1951,10 @@ interface MaterializedViewConfig<T> {
1946
1951
  /** @deprecated See {@link targetTable}
1947
1952
  * Optional ordering fields for the target table. Crucial if using ReplacingMergeTree. */
1948
1953
  orderByFields?: (keyof T & string)[];
1954
+ /** Optional metadata for the materialized view (e.g., description, source file). */
1955
+ metadata?: {
1956
+ [key: string]: any;
1957
+ };
1949
1958
  }
1950
1959
  /**
1951
1960
  * Represents a Materialized View in ClickHouse.
@@ -1965,8 +1974,10 @@ declare class MaterializedView<TargetTable> {
1965
1974
  selectSql: string;
1966
1975
  /** Names of source tables that the SELECT reads from */
1967
1976
  sourceTables: string[];
1968
- /** @internal Source file path where this MV was defined */
1969
- sourceFile?: string;
1977
+ /** Optional metadata for the materialized view */
1978
+ metadata: {
1979
+ [key: string]: any;
1980
+ };
1970
1981
  /**
1971
1982
  * Creates a new MaterializedView instance.
1972
1983
  * Requires the `TargetTable` type parameter to be explicitly provided or inferred,
@@ -1907,15 +1907,20 @@ declare class View {
1907
1907
  selectSql: string;
1908
1908
  /** Names of source tables/views that the SELECT reads from */
1909
1909
  sourceTables: string[];
1910
- /** @internal Source file path where this view was defined */
1911
- sourceFile?: string;
1910
+ /** Optional metadata for the view */
1911
+ metadata: {
1912
+ [key: string]: any;
1913
+ };
1912
1914
  /**
1913
1915
  * Creates a new View instance.
1914
1916
  * @param name The name of the view to be created.
1915
1917
  * @param selectStatement The SQL SELECT statement that defines the view's logic.
1916
1918
  * @param baseTables An array of OlapTable or View objects that the `selectStatement` reads from. Used for dependency tracking.
1919
+ * @param metadata Optional metadata for the view (e.g., description, source file).
1917
1920
  */
1918
- constructor(name: string, selectStatement: string | Sql, baseTables: (OlapTable<any> | View)[]);
1921
+ constructor(name: string, selectStatement: string | Sql, baseTables: (OlapTable<any> | View)[], metadata?: {
1922
+ [key: string]: any;
1923
+ });
1919
1924
  }
1920
1925
 
1921
1926
  /**
@@ -1946,6 +1951,10 @@ interface MaterializedViewConfig<T> {
1946
1951
  /** @deprecated See {@link targetTable}
1947
1952
  * Optional ordering fields for the target table. Crucial if using ReplacingMergeTree. */
1948
1953
  orderByFields?: (keyof T & string)[];
1954
+ /** Optional metadata for the materialized view (e.g., description, source file). */
1955
+ metadata?: {
1956
+ [key: string]: any;
1957
+ };
1949
1958
  }
1950
1959
  /**
1951
1960
  * Represents a Materialized View in ClickHouse.
@@ -1965,8 +1974,10 @@ declare class MaterializedView<TargetTable> {
1965
1974
  selectSql: string;
1966
1975
  /** Names of source tables that the SELECT reads from */
1967
1976
  sourceTables: string[];
1968
- /** @internal Source file path where this MV was defined */
1969
- sourceFile?: string;
1977
+ /** Optional metadata for the materialized view */
1978
+ metadata: {
1979
+ [key: string]: any;
1980
+ };
1970
1981
  /**
1971
1982
  * Creates a new MaterializedView instance.
1972
1983
  * Requires the `TargetTable` type parameter to be explicitly provided or inferred,
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-CkQfVyoI.mjs';
2
- import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-9XL-mk89.mjs';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, K as getCustomView, N as getCustomViews, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-9XL-mk89.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-CkJwv4dC.mjs';
2
+ import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-CdKEq7FH.mjs';
3
+ export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, K as getCustomView, N as getCustomViews, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-CdKEq7FH.mjs';
4
4
  import * as _clickhouse_client from '@clickhouse/client';
5
5
  import { KafkaJS } from '@514labs/kafka-javascript';
6
6
  import http from 'http';
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-CprLtYmW.js';
2
- import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-9XL-mk89.js';
3
- export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, K as getCustomView, N as getCustomViews, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-9XL-mk89.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-Dqfdy6x5.js';
2
+ import { a8 as MooseUtils, R as ApiUtil, a9 as MooseClient } from './index-CdKEq7FH.js';
3
+ export { A as Aggregated, h as Api, i as ApiConfig, ai as ApiHelpers, aa as Blocks, ab as ClickHouseEngines, C as ConsumptionApi, aj as ConsumptionHelpers, U as ConsumptionUtil, e as DeadLetter, D as DeadLetterModel, f as DeadLetterQueue, l as ETLPipeline, m as ETLPipelineConfig, E as EgressConfig, F as FrameworkApp, Y as IdentifierBrandedString, I as IngestApi, g as IngestConfig, j as IngestPipeline, L as LifeCycle, M as MaterializedView, Z as NonIdentifierBrandedString, a as OlapConfig, O as OlapTable, af as QueryClient, $ as RawValue, b as S3QueueTableSettings, S as SimpleAggregated, a1 as Sql, k as SqlResource, c as Stream, d as StreamConfig, T as Task, _ as Value, V as View, n as WebApp, o as WebAppConfig, p as WebAppHandler, W as Workflow, ag as WorkflowClient, a6 as createClickhouseParameter, ad as createMaterializedView, ac as dropView, x as getApi, w as getApis, K as getCustomView, N as getCustomViews, v as getIngestApi, u as getIngestApis, P as getMaterializedView, Q as getMaterializedViews, z as getSqlResource, y as getSqlResources, t as getStream, s as getStreams, r as getTable, q as getTables, ah as getTemporalClient, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, ak as joinQueries, a7 as mapToClickHouseType, ae as populateTable, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-CdKEq7FH.js';
4
4
  import * as _clickhouse_client from '@clickhouse/client';
5
5
  import { KafkaJS } from '@514labs/kafka-javascript';
6
6
  import http from 'http';
package/dist/index.js CHANGED
@@ -2508,8 +2508,8 @@ var init_materializedView = __esm({
2508
2508
  selectSql;
2509
2509
  /** Names of source tables that the SELECT reads from */
2510
2510
  sourceTables;
2511
- /** @internal Source file path where this MV was defined */
2512
- sourceFile;
2511
+ /** Optional metadata for the materialized view */
2512
+ metadata;
2513
2513
  constructor(options, targetSchema, targetColumns) {
2514
2514
  let selectStatement = options.selectStatement;
2515
2515
  if (typeof selectStatement !== "string") {
@@ -2540,8 +2540,14 @@ var init_materializedView = __esm({
2540
2540
  this.targetTable = targetTable;
2541
2541
  this.selectSql = selectStatement;
2542
2542
  this.sourceTables = options.selectTables.map((t) => t.name);
2543
- const stack = new Error().stack;
2544
- this.sourceFile = getSourceFileFromStack(stack);
2543
+ this.metadata = options.metadata ? { ...options.metadata } : {};
2544
+ if (!this.metadata.source) {
2545
+ const stack = new Error().stack;
2546
+ const sourceInfo = getSourceFileFromStack(stack);
2547
+ if (sourceInfo) {
2548
+ this.metadata.source = { file: sourceInfo };
2549
+ }
2550
+ }
2545
2551
  const materializedViews = getMooseInternal().materializedViews;
2546
2552
  if (!isClientOnlyMode() && materializedViews.has(this.name)) {
2547
2553
  throw new Error(`MaterializedView with name ${this.name} already exists`);
@@ -2632,23 +2638,30 @@ var init_view = __esm({
2632
2638
  selectSql;
2633
2639
  /** Names of source tables/views that the SELECT reads from */
2634
2640
  sourceTables;
2635
- /** @internal Source file path where this view was defined */
2636
- sourceFile;
2641
+ /** Optional metadata for the view */
2642
+ metadata;
2637
2643
  /**
2638
2644
  * Creates a new View instance.
2639
2645
  * @param name The name of the view to be created.
2640
2646
  * @param selectStatement The SQL SELECT statement that defines the view's logic.
2641
2647
  * @param baseTables An array of OlapTable or View objects that the `selectStatement` reads from. Used for dependency tracking.
2648
+ * @param metadata Optional metadata for the view (e.g., description, source file).
2642
2649
  */
2643
- constructor(name, selectStatement, baseTables) {
2650
+ constructor(name, selectStatement, baseTables, metadata) {
2644
2651
  if (typeof selectStatement !== "string") {
2645
2652
  selectStatement = toStaticQuery(selectStatement);
2646
2653
  }
2647
2654
  this.name = name;
2648
2655
  this.selectSql = selectStatement;
2649
2656
  this.sourceTables = baseTables.map((t) => t.name);
2650
- const stack = new Error().stack;
2651
- this.sourceFile = getSourceFileFromStack(stack);
2657
+ this.metadata = metadata ? { ...metadata } : {};
2658
+ if (!this.metadata.source) {
2659
+ const stack = new Error().stack;
2660
+ const sourceInfo = getSourceFileFromStack(stack);
2661
+ if (sourceInfo) {
2662
+ this.metadata.source = { file: sourceInfo };
2663
+ }
2664
+ }
2652
2665
  const customViews = getMooseInternal().customViews;
2653
2666
  if (!isClientOnlyMode() && customViews.has(this.name)) {
2654
2667
  throw new Error(`View with name ${this.name} already exists`);