@514labs/moose-lib 0.6.297-ci-22-g1be0de24 → 0.6.297-ci-35-g4e0a867f

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.
@@ -1,4 +1,4 @@
1
- import './index-9XL-mk89.js';
1
+ import './index-CcHF2cVT.js';
2
2
  import { Pattern, TagBase } from 'typia/lib/tags';
3
3
  import { tags } from 'typia';
4
4
 
@@ -1,4 +1,4 @@
1
- import './index-9XL-mk89.mjs';
1
+ import './index-CcHF2cVT.mjs';
2
2
  import { Pattern, TagBase } from 'typia/lib/tags';
3
3
  import { tags } from 'typia';
4
4
 
@@ -1,5 +1,5 @@
1
- export { A as Aggregated, h as Api, i as ApiConfig, R as ApiUtil, C as ConsumptionApi, 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, $ 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, a6 as createClickhouseParameter, 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, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, a7 as mapToClickHouseType, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-9XL-mk89.mjs';
2
- 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, p as ClickHouseMaterialized, b as ClickHouseNamedTuple, i as ClickHousePrecision, 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';
1
+ export { A as Aggregated, h as Api, i as ApiConfig, K as ApiUtil, C as ConsumptionApi, 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, 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, a2 as createClickhouseParameter, 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, a1 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, a3 as mapToClickHouseType, P as quoteIdentifier, Y as sql, $ as toQuery, a0 as toQueryPreview, _ as toStaticQuery } from './index-CcHF2cVT.mjs';
2
+ 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, p as ClickHouseMaterialized, b as ClickHouseNamedTuple, i as ClickHousePrecision, 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';
3
3
  import 'typia';
4
4
  import 'typia/src/schemas/json/IJsonSchemaCollection';
5
5
  import 'node:stream';
@@ -1,5 +1,5 @@
1
- export { A as Aggregated, h as Api, i as ApiConfig, R as ApiUtil, C as ConsumptionApi, 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, $ 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, a6 as createClickhouseParameter, 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, a5 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, a7 as mapToClickHouseType, X as quoteIdentifier, a0 as sql, a3 as toQuery, a4 as toQueryPreview, a2 as toStaticQuery } from './index-9XL-mk89.js';
2
- 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, p as ClickHouseMaterialized, b as ClickHouseNamedTuple, i as ClickHousePrecision, 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';
1
+ export { A as Aggregated, h as Api, i as ApiConfig, K as ApiUtil, C as ConsumptionApi, 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, 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, a2 as createClickhouseParameter, 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, a1 as getValueFromParameter, J as getWebApp, H as getWebApps, G as getWorkflow, B as getWorkflows, a3 as mapToClickHouseType, P as quoteIdentifier, Y as sql, $ as toQuery, a0 as toQueryPreview, _ as toStaticQuery } from './index-CcHF2cVT.js';
2
+ 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, p as ClickHouseMaterialized, b as ClickHouseNamedTuple, i as ClickHousePrecision, 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';
3
3
  import 'typia';
4
4
  import 'typia/src/schemas/json/IJsonSchemaCollection';
5
5
  import 'node:stream';
@@ -334,6 +334,14 @@ var init_sqlHelpers = __esm({
334
334
  });
335
335
 
336
336
  // src/blocks/helpers.ts
337
+ function dropView(name) {
338
+ return `DROP VIEW IF EXISTS ${quoteIdentifier(name)}`.trim();
339
+ }
340
+ function createMaterializedView(options) {
341
+ return `CREATE MATERIALIZED VIEW IF NOT EXISTS ${quoteIdentifier(options.name)}
342
+ TO ${quoteIdentifier(options.destinationTable)}
343
+ AS ${options.select}`.trim();
344
+ }
337
345
  var init_helpers = __esm({
338
346
  "src/blocks/helpers.ts"() {
339
347
  "use strict";
@@ -674,9 +682,7 @@ var init_internal = __esm({
674
682
  apis: /* @__PURE__ */ new Map(),
675
683
  sqlResources: /* @__PURE__ */ new Map(),
676
684
  workflows: /* @__PURE__ */ new Map(),
677
- webApps: /* @__PURE__ */ new Map(),
678
- materializedViews: /* @__PURE__ */ new Map(),
679
- customViews: /* @__PURE__ */ new Map()
685
+ webApps: /* @__PURE__ */ new Map()
680
686
  };
681
687
  defaultRetentionPeriod = 60 * 60 * 24 * 7;
682
688
  getMooseInternal = () => globalThis.moose_internal;
@@ -2557,78 +2563,6 @@ var init_etlPipeline = __esm({
2557
2563
  }
2558
2564
  });
2559
2565
 
2560
- // src/dmv2/sdk/materializedView.ts
2561
- var requireTargetTableName, MaterializedView;
2562
- var init_materializedView = __esm({
2563
- "src/dmv2/sdk/materializedView.ts"() {
2564
- "use strict";
2565
- init_helpers();
2566
- init_sqlHelpers();
2567
- init_olapTable();
2568
- init_internal();
2569
- init_stackTrace();
2570
- requireTargetTableName = (tableName) => {
2571
- if (typeof tableName === "string") {
2572
- return tableName;
2573
- } else {
2574
- throw new Error("Name of targetTable is not specified.");
2575
- }
2576
- };
2577
- MaterializedView = class {
2578
- /** @internal */
2579
- kind = "MaterializedView";
2580
- /** The name of the materialized view */
2581
- name;
2582
- /** The target OlapTable instance where the materialized data is stored. */
2583
- targetTable;
2584
- /** The SELECT SQL statement */
2585
- selectSql;
2586
- /** Names of source tables that the SELECT reads from */
2587
- sourceTables;
2588
- /** @internal Source file path where this MV was defined */
2589
- sourceFile;
2590
- constructor(options, targetSchema, targetColumns) {
2591
- let selectStatement = options.selectStatement;
2592
- if (typeof selectStatement !== "string") {
2593
- selectStatement = toStaticQuery(selectStatement);
2594
- }
2595
- if (targetSchema === void 0 || targetColumns === void 0) {
2596
- throw new Error(
2597
- "Supply the type param T so that the schema is inserted by the compiler plugin."
2598
- );
2599
- }
2600
- const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
2601
- requireTargetTableName(
2602
- options.targetTable?.name ?? options.tableName
2603
- ),
2604
- {
2605
- orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
2606
- engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
2607
- },
2608
- targetSchema,
2609
- targetColumns
2610
- );
2611
- if (targetTable.name === options.materializedViewName) {
2612
- throw new Error(
2613
- "Materialized view name cannot be the same as the target table name."
2614
- );
2615
- }
2616
- this.name = options.materializedViewName;
2617
- this.targetTable = targetTable;
2618
- this.selectSql = selectStatement;
2619
- this.sourceTables = options.selectTables.map((t) => t.name);
2620
- const stack = new Error().stack;
2621
- this.sourceFile = getSourceFileFromStack(stack);
2622
- const materializedViews = getMooseInternal().materializedViews;
2623
- if (!isClientOnlyMode() && materializedViews.has(this.name)) {
2624
- throw new Error(`MaterializedView with name ${this.name} already exists`);
2625
- }
2626
- materializedViews.set(this.name, this);
2627
- }
2628
- };
2629
- }
2630
- });
2631
-
2632
2566
  // src/dmv2/sdk/sqlResource.ts
2633
2567
  var SqlResource;
2634
2568
  var init_sqlResource = __esm({
@@ -2692,25 +2626,83 @@ var init_sqlResource = __esm({
2692
2626
  }
2693
2627
  });
2694
2628
 
2629
+ // src/dmv2/sdk/materializedView.ts
2630
+ var requireTargetTableName, MaterializedView;
2631
+ var init_materializedView = __esm({
2632
+ "src/dmv2/sdk/materializedView.ts"() {
2633
+ "use strict";
2634
+ init_helpers();
2635
+ init_sqlHelpers();
2636
+ init_olapTable();
2637
+ init_sqlResource();
2638
+ requireTargetTableName = (tableName) => {
2639
+ if (typeof tableName === "string") {
2640
+ return tableName;
2641
+ } else {
2642
+ throw new Error("Name of targetTable is not specified.");
2643
+ }
2644
+ };
2645
+ MaterializedView = class extends SqlResource {
2646
+ /** The target OlapTable instance where the materialized data is stored. */
2647
+ targetTable;
2648
+ constructor(options, targetSchema, targetColumns) {
2649
+ let selectStatement = options.selectStatement;
2650
+ if (typeof selectStatement !== "string") {
2651
+ selectStatement = toStaticQuery(selectStatement);
2652
+ }
2653
+ if (targetSchema === void 0 || targetColumns === void 0) {
2654
+ throw new Error(
2655
+ "Supply the type param T so that the schema is inserted by the compiler plugin."
2656
+ );
2657
+ }
2658
+ const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
2659
+ requireTargetTableName(
2660
+ options.targetTable?.name ?? options.tableName
2661
+ ),
2662
+ {
2663
+ orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
2664
+ engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
2665
+ },
2666
+ targetSchema,
2667
+ targetColumns
2668
+ );
2669
+ if (targetTable.name === options.materializedViewName) {
2670
+ throw new Error(
2671
+ "Materialized view name cannot be the same as the target table name."
2672
+ );
2673
+ }
2674
+ super(
2675
+ options.materializedViewName,
2676
+ [
2677
+ createMaterializedView({
2678
+ name: options.materializedViewName,
2679
+ destinationTable: targetTable.name,
2680
+ select: selectStatement
2681
+ })
2682
+ // Population is now handled automatically by Rust infrastructure
2683
+ // based on table engine type and whether this is a new or updated view
2684
+ ],
2685
+ [dropView(options.materializedViewName)],
2686
+ {
2687
+ pullsDataFrom: options.selectTables,
2688
+ pushesDataTo: [targetTable]
2689
+ }
2690
+ );
2691
+ this.targetTable = targetTable;
2692
+ }
2693
+ };
2694
+ }
2695
+ });
2696
+
2695
2697
  // src/dmv2/sdk/view.ts
2696
2698
  var View;
2697
2699
  var init_view = __esm({
2698
2700
  "src/dmv2/sdk/view.ts"() {
2699
2701
  "use strict";
2702
+ init_helpers();
2700
2703
  init_sqlHelpers();
2701
- init_internal();
2702
- init_stackTrace();
2703
- View = class {
2704
- /** @internal */
2705
- kind = "CustomView";
2706
- /** The name of the view */
2707
- name;
2708
- /** The SELECT SQL statement that defines the view */
2709
- selectSql;
2710
- /** Names of source tables/views that the SELECT reads from */
2711
- sourceTables;
2712
- /** @internal Source file path where this view was defined */
2713
- sourceFile;
2704
+ init_sqlResource();
2705
+ View = class extends SqlResource {
2714
2706
  /**
2715
2707
  * Creates a new View instance.
2716
2708
  * @param name The name of the view to be created.
@@ -2721,16 +2713,17 @@ var init_view = __esm({
2721
2713
  if (typeof selectStatement !== "string") {
2722
2714
  selectStatement = toStaticQuery(selectStatement);
2723
2715
  }
2724
- this.name = name;
2725
- this.selectSql = selectStatement;
2726
- this.sourceTables = baseTables.map((t) => t.name);
2727
- const stack = new Error().stack;
2728
- this.sourceFile = getSourceFileFromStack(stack);
2729
- const customViews = getMooseInternal().customViews;
2730
- if (!isClientOnlyMode() && customViews.has(this.name)) {
2731
- throw new Error(`View with name ${this.name} already exists`);
2732
- }
2733
- customViews.set(this.name, this);
2716
+ super(
2717
+ name,
2718
+ [
2719
+ `CREATE VIEW IF NOT EXISTS ${name}
2720
+ AS ${selectStatement}`.trim()
2721
+ ],
2722
+ [dropView(name)],
2723
+ {
2724
+ pullsDataFrom: baseTables
2725
+ }
2726
+ );
2734
2727
  }
2735
2728
  };
2736
2729
  }
@@ -2934,18 +2927,6 @@ function getWebApps2() {
2934
2927
  function getWebApp(name) {
2935
2928
  return getMooseInternal().webApps.get(name);
2936
2929
  }
2937
- function getMaterializedViews() {
2938
- return getMooseInternal().materializedViews;
2939
- }
2940
- function getMaterializedView(name) {
2941
- return getMooseInternal().materializedViews.get(name);
2942
- }
2943
- function getCustomViews() {
2944
- return getMooseInternal().customViews;
2945
- }
2946
- function getCustomView(name) {
2947
- return getMooseInternal().customViews.get(name);
2948
- }
2949
2930
  var init_registry = __esm({
2950
2931
  "src/dmv2/registry.ts"() {
2951
2932
  "use strict";
@@ -2995,12 +2976,8 @@ __export(browserCompatible_exports, {
2995
2976
  createClickhouseParameter: () => createClickhouseParameter,
2996
2977
  getApi: () => getApi,
2997
2978
  getApis: () => getApis2,
2998
- getCustomView: () => getCustomView,
2999
- getCustomViews: () => getCustomViews,
3000
2979
  getIngestApi: () => getIngestApi,
3001
2980
  getIngestApis: () => getIngestApis,
3002
- getMaterializedView: () => getMaterializedView,
3003
- getMaterializedViews: () => getMaterializedViews,
3004
2981
  getSqlResource: () => getSqlResource,
3005
2982
  getSqlResources: () => getSqlResources,
3006
2983
  getStream: () => getStream,
@@ -3049,12 +3026,8 @@ init_browserCompatible();
3049
3026
  createClickhouseParameter,
3050
3027
  getApi,
3051
3028
  getApis,
3052
- getCustomView,
3053
- getCustomViews,
3054
3029
  getIngestApi,
3055
3030
  getIngestApis,
3056
- getMaterializedView,
3057
- getMaterializedViews,
3058
3031
  getSqlResource,
3059
3032
  getSqlResources,
3060
3033
  getStream,