@514labs/moose-lib 0.6.288 → 0.6.289-ci-7-ge6ab7015

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.
Files changed (35) hide show
  1. package/dist/{browserCompatible-BUKAJYbj.d.ts → browserCompatible-B2F3r37v.d.ts} +1 -1
  2. package/dist/{browserCompatible-15NCyT1P.d.mts → browserCompatible-DVf1GCzu.d.mts} +1 -1
  3. package/dist/browserCompatible.d.mts +2 -2
  4. package/dist/browserCompatible.d.ts +2 -2
  5. package/dist/browserCompatible.js +95 -86
  6. package/dist/browserCompatible.js.map +1 -1
  7. package/dist/browserCompatible.mjs +95 -86
  8. package/dist/browserCompatible.mjs.map +1 -1
  9. package/dist/compilerPlugin.js +4 -1
  10. package/dist/compilerPlugin.js.map +1 -1
  11. package/dist/compilerPlugin.mjs +5 -1
  12. package/dist/compilerPlugin.mjs.map +1 -1
  13. package/dist/dataModels/toDataModels.js +4 -1
  14. package/dist/dataModels/toDataModels.js.map +1 -1
  15. package/dist/dataModels/toDataModels.mjs +5 -1
  16. package/dist/dataModels/toDataModels.mjs.map +1 -1
  17. package/dist/dmv2/index.d.mts +1 -1
  18. package/dist/dmv2/index.d.ts +1 -1
  19. package/dist/dmv2/index.js +115 -86
  20. package/dist/dmv2/index.js.map +1 -1
  21. package/dist/dmv2/index.mjs +111 -86
  22. package/dist/dmv2/index.mjs.map +1 -1
  23. package/dist/{index-BtkwFbT9.d.mts → index-C0jZ1bu4.d.mts} +84 -41
  24. package/dist/{index-BtkwFbT9.d.ts → index-C0jZ1bu4.d.ts} +84 -41
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +97 -76
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +97 -76
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/moose-runner.js +28 -2
  32. package/dist/moose-runner.js.map +1 -1
  33. package/dist/moose-runner.mjs +28 -2
  34. package/dist/moose-runner.mjs.map +1 -1
  35. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import './index-BtkwFbT9.js';
1
+ import './index-C0jZ1bu4.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-BtkwFbT9.mjs';
1
+ import './index-C0jZ1bu4.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, 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-BtkwFbT9.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-15NCyT1P.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-C0jZ1bu4.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-DVf1GCzu.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, 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-BtkwFbT9.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-BUKAJYbj.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-C0jZ1bu4.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-B2F3r37v.js';
3
3
  import 'typia';
4
4
  import 'typia/src/schemas/json/IJsonSchemaCollection';
5
5
  import 'node:stream';
@@ -705,16 +705,6 @@ function emptyIfUndefined(value) {
705
705
  return value === void 0 ? "" : value;
706
706
  }
707
707
 
708
- // src/blocks/helpers.ts
709
- function dropView(name) {
710
- return `DROP VIEW IF EXISTS ${quoteIdentifier(name)}`.trim();
711
- }
712
- function createMaterializedView(options) {
713
- return `CREATE MATERIALIZED VIEW IF NOT EXISTS ${quoteIdentifier(options.name)}
714
- TO ${quoteIdentifier(options.destinationTable)}
715
- AS ${options.select}`.trim();
716
- }
717
-
718
708
  // src/dmv2/internal.ts
719
709
  var import_process = __toESM(require("process"));
720
710
 
@@ -765,7 +755,9 @@ var moose_internal = {
765
755
  apis: /* @__PURE__ */ new Map(),
766
756
  sqlResources: /* @__PURE__ */ new Map(),
767
757
  workflows: /* @__PURE__ */ new Map(),
768
- webApps: /* @__PURE__ */ new Map()
758
+ webApps: /* @__PURE__ */ new Map(),
759
+ materializedViews: /* @__PURE__ */ new Map(),
760
+ customViews: /* @__PURE__ */ new Map()
769
761
  };
770
762
  var defaultRetentionPeriod = 60 * 60 * 24 * 7;
771
763
  var getMooseInternal = () => globalThis.moose_internal;
@@ -840,7 +832,8 @@ var dlqColumns = [
840
832
  annotations: [],
841
833
  ttl: null,
842
834
  codec: null,
843
- materialized: null
835
+ materialized: null,
836
+ comment: null
844
837
  },
845
838
  {
846
839
  name: "errorMessage",
@@ -852,7 +845,8 @@ var dlqColumns = [
852
845
  annotations: [],
853
846
  ttl: null,
854
847
  codec: null,
855
- materialized: null
848
+ materialized: null,
849
+ comment: null
856
850
  },
857
851
  {
858
852
  name: "errorType",
@@ -864,7 +858,8 @@ var dlqColumns = [
864
858
  annotations: [],
865
859
  ttl: null,
866
860
  codec: null,
867
- materialized: null
861
+ materialized: null,
862
+ comment: null
868
863
  },
869
864
  {
870
865
  name: "failedAt",
@@ -876,7 +871,8 @@ var dlqColumns = [
876
871
  annotations: [],
877
872
  ttl: null,
878
873
  codec: null,
879
- materialized: null
874
+ materialized: null,
875
+ comment: null
880
876
  },
881
877
  {
882
878
  name: "source",
@@ -888,7 +884,8 @@ var dlqColumns = [
888
884
  annotations: [],
889
885
  ttl: null,
890
886
  codec: null,
891
- materialized: null
887
+ materialized: null,
888
+ comment: null
892
889
  }
893
890
  ];
894
891
 
@@ -2394,6 +2391,67 @@ var ETLPipeline = class {
2394
2391
  }
2395
2392
  };
2396
2393
 
2394
+ // src/dmv2/sdk/materializedView.ts
2395
+ var requireTargetTableName = (tableName) => {
2396
+ if (typeof tableName === "string") {
2397
+ return tableName;
2398
+ } else {
2399
+ throw new Error("Name of targetTable is not specified.");
2400
+ }
2401
+ };
2402
+ var MaterializedView = class {
2403
+ /** @internal */
2404
+ kind = "MaterializedView";
2405
+ /** The name of the materialized view */
2406
+ name;
2407
+ /** The target OlapTable instance where the materialized data is stored. */
2408
+ targetTable;
2409
+ /** The SELECT SQL statement */
2410
+ selectSql;
2411
+ /** Names of source tables that the SELECT reads from */
2412
+ sourceTables;
2413
+ /** @internal Source file path where this MV was defined */
2414
+ sourceFile;
2415
+ constructor(options, targetSchema, targetColumns) {
2416
+ let selectStatement = options.selectStatement;
2417
+ if (typeof selectStatement !== "string") {
2418
+ selectStatement = toStaticQuery(selectStatement);
2419
+ }
2420
+ if (targetSchema === void 0 || targetColumns === void 0) {
2421
+ throw new Error(
2422
+ "Supply the type param T so that the schema is inserted by the compiler plugin."
2423
+ );
2424
+ }
2425
+ const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
2426
+ requireTargetTableName(
2427
+ options.targetTable?.name ?? options.tableName
2428
+ ),
2429
+ {
2430
+ orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
2431
+ engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
2432
+ },
2433
+ targetSchema,
2434
+ targetColumns
2435
+ );
2436
+ if (targetTable.name === options.materializedViewName) {
2437
+ throw new Error(
2438
+ "Materialized view name cannot be the same as the target table name."
2439
+ );
2440
+ }
2441
+ this.name = options.materializedViewName;
2442
+ this.targetTable = targetTable;
2443
+ this.selectSql = selectStatement;
2444
+ this.sourceTables = options.selectTables.map((t) => t.name);
2445
+ const stack = new Error().stack;
2446
+ this.sourceFile = getSourceFileFromStack(stack);
2447
+ const materializedViews = getMooseInternal().materializedViews;
2448
+ if (!isClientOnlyMode() && materializedViews.has(this.name)) {
2449
+ throw new Error(`MaterializedView with name ${this.name} already exists`);
2450
+ }
2451
+ materializedViews.set(this.name, this);
2452
+ }
2453
+ };
2454
+
2397
2455
  // src/dmv2/sdk/sqlResource.ts
2398
2456
  var SqlResource = class {
2399
2457
  /** @internal */
@@ -2448,66 +2506,18 @@ var SqlResource = class {
2448
2506
  }
2449
2507
  };
2450
2508
 
2451
- // src/dmv2/sdk/materializedView.ts
2452
- var requireTargetTableName = (tableName) => {
2453
- if (typeof tableName === "string") {
2454
- return tableName;
2455
- } else {
2456
- throw new Error("Name of targetTable is not specified.");
2457
- }
2458
- };
2459
- var MaterializedView = class extends SqlResource {
2460
- /** The target OlapTable instance where the materialized data is stored. */
2461
- targetTable;
2462
- constructor(options, targetSchema, targetColumns) {
2463
- let selectStatement = options.selectStatement;
2464
- if (typeof selectStatement !== "string") {
2465
- selectStatement = toStaticQuery(selectStatement);
2466
- }
2467
- if (targetSchema === void 0 || targetColumns === void 0) {
2468
- throw new Error(
2469
- "Supply the type param T so that the schema is inserted by the compiler plugin."
2470
- );
2471
- }
2472
- const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
2473
- requireTargetTableName(
2474
- options.targetTable?.name ?? options.tableName
2475
- ),
2476
- {
2477
- orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
2478
- engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
2479
- },
2480
- targetSchema,
2481
- targetColumns
2482
- );
2483
- if (targetTable.name === options.materializedViewName) {
2484
- throw new Error(
2485
- "Materialized view name cannot be the same as the target table name."
2486
- );
2487
- }
2488
- super(
2489
- options.materializedViewName,
2490
- [
2491
- createMaterializedView({
2492
- name: options.materializedViewName,
2493
- destinationTable: targetTable.name,
2494
- select: selectStatement
2495
- })
2496
- // Population is now handled automatically by Rust infrastructure
2497
- // based on table engine type and whether this is a new or updated view
2498
- ],
2499
- [dropView(options.materializedViewName)],
2500
- {
2501
- pullsDataFrom: options.selectTables,
2502
- pushesDataTo: [targetTable]
2503
- }
2504
- );
2505
- this.targetTable = targetTable;
2506
- }
2507
- };
2508
-
2509
2509
  // src/dmv2/sdk/view.ts
2510
- var View = class extends SqlResource {
2510
+ var View = class {
2511
+ /** @internal */
2512
+ kind = "CustomView";
2513
+ /** The name of the view */
2514
+ name;
2515
+ /** The SELECT SQL statement that defines the view */
2516
+ selectSql;
2517
+ /** Names of source tables/views that the SELECT reads from */
2518
+ sourceTables;
2519
+ /** @internal Source file path where this view was defined */
2520
+ sourceFile;
2511
2521
  /**
2512
2522
  * Creates a new View instance.
2513
2523
  * @param name The name of the view to be created.
@@ -2518,17 +2528,16 @@ var View = class extends SqlResource {
2518
2528
  if (typeof selectStatement !== "string") {
2519
2529
  selectStatement = toStaticQuery(selectStatement);
2520
2530
  }
2521
- super(
2522
- name,
2523
- [
2524
- `CREATE VIEW IF NOT EXISTS ${name}
2525
- AS ${selectStatement}`.trim()
2526
- ],
2527
- [dropView(name)],
2528
- {
2529
- pullsDataFrom: baseTables
2530
- }
2531
- );
2531
+ this.name = name;
2532
+ this.selectSql = selectStatement;
2533
+ this.sourceTables = baseTables.map((t) => t.name);
2534
+ const stack = new Error().stack;
2535
+ this.sourceFile = getSourceFileFromStack(stack);
2536
+ const customViews = getMooseInternal().customViews;
2537
+ if (!isClientOnlyMode() && customViews.has(this.name)) {
2538
+ throw new Error(`View with name ${this.name} already exists`);
2539
+ }
2540
+ customViews.set(this.name, this);
2532
2541
  }
2533
2542
  };
2534
2543