@514labs/moose-lib 0.6.297-ci-4-g3b2674ae → 0.6.297-ci-22-g1be0de24
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-FzU17dxm.d.mts → browserCompatible-CkQfVyoI.d.mts} +1 -1
- package/dist/{browserCompatible-CMEunMFq.d.ts → browserCompatible-CprLtYmW.d.ts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +118 -91
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +114 -91
- 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 +118 -91
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +114 -91
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-CcHF2cVT.d.mts → index-9XL-mk89.d.mts} +83 -41
- package/dist/{index-CcHF2cVT.d.ts → index-9XL-mk89.d.ts} +83 -41
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +120 -83
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +116 -83
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +41 -14
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +41 -14
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as Aggregated, h as Api, i as ApiConfig,
|
|
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-
|
|
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';
|
|
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,
|
|
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-
|
|
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';
|
|
3
3
|
import 'typia';
|
|
4
4
|
import 'typia/src/schemas/json/IJsonSchemaCollection';
|
|
5
5
|
import 'node:stream';
|
|
@@ -334,14 +334,6 @@ 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
|
-
}
|
|
345
337
|
var init_helpers = __esm({
|
|
346
338
|
"src/blocks/helpers.ts"() {
|
|
347
339
|
"use strict";
|
|
@@ -682,7 +674,9 @@ var init_internal = __esm({
|
|
|
682
674
|
apis: /* @__PURE__ */ new Map(),
|
|
683
675
|
sqlResources: /* @__PURE__ */ new Map(),
|
|
684
676
|
workflows: /* @__PURE__ */ new Map(),
|
|
685
|
-
webApps: /* @__PURE__ */ new Map()
|
|
677
|
+
webApps: /* @__PURE__ */ new Map(),
|
|
678
|
+
materializedViews: /* @__PURE__ */ new Map(),
|
|
679
|
+
customViews: /* @__PURE__ */ new Map()
|
|
686
680
|
};
|
|
687
681
|
defaultRetentionPeriod = 60 * 60 * 24 * 7;
|
|
688
682
|
getMooseInternal = () => globalThis.moose_internal;
|
|
@@ -2563,6 +2557,78 @@ var init_etlPipeline = __esm({
|
|
|
2563
2557
|
}
|
|
2564
2558
|
});
|
|
2565
2559
|
|
|
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
|
+
|
|
2566
2632
|
// src/dmv2/sdk/sqlResource.ts
|
|
2567
2633
|
var SqlResource;
|
|
2568
2634
|
var init_sqlResource = __esm({
|
|
@@ -2626,83 +2692,25 @@ var init_sqlResource = __esm({
|
|
|
2626
2692
|
}
|
|
2627
2693
|
});
|
|
2628
2694
|
|
|
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
|
-
|
|
2697
2695
|
// src/dmv2/sdk/view.ts
|
|
2698
2696
|
var View;
|
|
2699
2697
|
var init_view = __esm({
|
|
2700
2698
|
"src/dmv2/sdk/view.ts"() {
|
|
2701
2699
|
"use strict";
|
|
2702
|
-
init_helpers();
|
|
2703
2700
|
init_sqlHelpers();
|
|
2704
|
-
|
|
2705
|
-
|
|
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;
|
|
2706
2714
|
/**
|
|
2707
2715
|
* Creates a new View instance.
|
|
2708
2716
|
* @param name The name of the view to be created.
|
|
@@ -2713,17 +2721,16 @@ var init_view = __esm({
|
|
|
2713
2721
|
if (typeof selectStatement !== "string") {
|
|
2714
2722
|
selectStatement = toStaticQuery(selectStatement);
|
|
2715
2723
|
}
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
{
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
);
|
|
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);
|
|
2727
2734
|
}
|
|
2728
2735
|
};
|
|
2729
2736
|
}
|
|
@@ -2927,6 +2934,18 @@ function getWebApps2() {
|
|
|
2927
2934
|
function getWebApp(name) {
|
|
2928
2935
|
return getMooseInternal().webApps.get(name);
|
|
2929
2936
|
}
|
|
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
|
+
}
|
|
2930
2949
|
var init_registry = __esm({
|
|
2931
2950
|
"src/dmv2/registry.ts"() {
|
|
2932
2951
|
"use strict";
|
|
@@ -2976,8 +2995,12 @@ __export(browserCompatible_exports, {
|
|
|
2976
2995
|
createClickhouseParameter: () => createClickhouseParameter,
|
|
2977
2996
|
getApi: () => getApi,
|
|
2978
2997
|
getApis: () => getApis2,
|
|
2998
|
+
getCustomView: () => getCustomView,
|
|
2999
|
+
getCustomViews: () => getCustomViews,
|
|
2979
3000
|
getIngestApi: () => getIngestApi,
|
|
2980
3001
|
getIngestApis: () => getIngestApis,
|
|
3002
|
+
getMaterializedView: () => getMaterializedView,
|
|
3003
|
+
getMaterializedViews: () => getMaterializedViews,
|
|
2981
3004
|
getSqlResource: () => getSqlResource,
|
|
2982
3005
|
getSqlResources: () => getSqlResources,
|
|
2983
3006
|
getStream: () => getStream,
|
|
@@ -3026,8 +3049,12 @@ init_browserCompatible();
|
|
|
3026
3049
|
createClickhouseParameter,
|
|
3027
3050
|
getApi,
|
|
3028
3051
|
getApis,
|
|
3052
|
+
getCustomView,
|
|
3053
|
+
getCustomViews,
|
|
3029
3054
|
getIngestApi,
|
|
3030
3055
|
getIngestApis,
|
|
3056
|
+
getMaterializedView,
|
|
3057
|
+
getMaterializedViews,
|
|
3031
3058
|
getSqlResource,
|
|
3032
3059
|
getSqlResources,
|
|
3033
3060
|
getStream,
|