@514labs/moose-lib 0.6.266-ci-2-g933b2685 → 0.6.266-ci-8-ge6e86870
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-CpjUXotI.d.ts → browserCompatible-vY6tmKGn.d.ts} +1 -1
- package/dist/{browserCompatible-fk6xPzoB.d.mts → browserCompatible-y8O70Ttx.d.mts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +85 -81
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +85 -81
- 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 +85 -81
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +85 -81
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-Dd3ZmpTq.d.mts → index-DSzxmiN9.d.mts} +60 -40
- package/dist/{index-Dd3ZmpTq.d.ts → index-DSzxmiN9.d.ts} +60 -40
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +87 -71
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +87 -71
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +28 -2
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +28 -2
- 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, 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-
|
|
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, 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-DSzxmiN9.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-y8O70Ttx.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-
|
|
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, 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-DSzxmiN9.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-vY6tmKGn.js';
|
|
3
3
|
import 'typia';
|
|
4
4
|
import 'typia/src/schemas/json/IJsonSchemaCollection';
|
|
5
5
|
import 'node:stream';
|
|
@@ -702,16 +702,6 @@ function emptyIfUndefined(value) {
|
|
|
702
702
|
return value === void 0 ? "" : value;
|
|
703
703
|
}
|
|
704
704
|
|
|
705
|
-
// src/blocks/helpers.ts
|
|
706
|
-
function dropView(name) {
|
|
707
|
-
return `DROP VIEW IF EXISTS ${quoteIdentifier(name)}`.trim();
|
|
708
|
-
}
|
|
709
|
-
function createMaterializedView(options) {
|
|
710
|
-
return `CREATE MATERIALIZED VIEW IF NOT EXISTS ${quoteIdentifier(options.name)}
|
|
711
|
-
TO ${quoteIdentifier(options.destinationTable)}
|
|
712
|
-
AS ${options.select}`.trim();
|
|
713
|
-
}
|
|
714
|
-
|
|
715
705
|
// src/dmv2/internal.ts
|
|
716
706
|
var import_process = __toESM(require("process"));
|
|
717
707
|
|
|
@@ -762,7 +752,9 @@ var moose_internal = {
|
|
|
762
752
|
apis: /* @__PURE__ */ new Map(),
|
|
763
753
|
sqlResources: /* @__PURE__ */ new Map(),
|
|
764
754
|
workflows: /* @__PURE__ */ new Map(),
|
|
765
|
-
webApps: /* @__PURE__ */ new Map()
|
|
755
|
+
webApps: /* @__PURE__ */ new Map(),
|
|
756
|
+
materializedViews: /* @__PURE__ */ new Map(),
|
|
757
|
+
customViews: /* @__PURE__ */ new Map()
|
|
766
758
|
};
|
|
767
759
|
var defaultRetentionPeriod = 60 * 60 * 24 * 7;
|
|
768
760
|
var getMooseInternal = () => globalThis.moose_internal;
|
|
@@ -2389,6 +2381,67 @@ var ETLPipeline = class {
|
|
|
2389
2381
|
}
|
|
2390
2382
|
};
|
|
2391
2383
|
|
|
2384
|
+
// src/dmv2/sdk/materializedView.ts
|
|
2385
|
+
var requireTargetTableName = (tableName) => {
|
|
2386
|
+
if (typeof tableName === "string") {
|
|
2387
|
+
return tableName;
|
|
2388
|
+
} else {
|
|
2389
|
+
throw new Error("Name of targetTable is not specified.");
|
|
2390
|
+
}
|
|
2391
|
+
};
|
|
2392
|
+
var MaterializedView = class {
|
|
2393
|
+
/** @internal */
|
|
2394
|
+
kind = "MaterializedView";
|
|
2395
|
+
/** The name of the materialized view */
|
|
2396
|
+
name;
|
|
2397
|
+
/** The target OlapTable instance where the materialized data is stored. */
|
|
2398
|
+
targetTable;
|
|
2399
|
+
/** The SELECT SQL statement */
|
|
2400
|
+
selectSql;
|
|
2401
|
+
/** Names of source tables that the SELECT reads from */
|
|
2402
|
+
sourceTables;
|
|
2403
|
+
/** @internal Source file path where this MV was defined */
|
|
2404
|
+
sourceFile;
|
|
2405
|
+
constructor(options, targetSchema, targetColumns) {
|
|
2406
|
+
let selectStatement = options.selectStatement;
|
|
2407
|
+
if (typeof selectStatement !== "string") {
|
|
2408
|
+
selectStatement = toStaticQuery(selectStatement);
|
|
2409
|
+
}
|
|
2410
|
+
if (targetSchema === void 0 || targetColumns === void 0) {
|
|
2411
|
+
throw new Error(
|
|
2412
|
+
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
|
|
2416
|
+
requireTargetTableName(
|
|
2417
|
+
options.targetTable?.name ?? options.tableName
|
|
2418
|
+
),
|
|
2419
|
+
{
|
|
2420
|
+
orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
|
|
2421
|
+
engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
|
|
2422
|
+
},
|
|
2423
|
+
targetSchema,
|
|
2424
|
+
targetColumns
|
|
2425
|
+
);
|
|
2426
|
+
if (targetTable.name === options.materializedViewName) {
|
|
2427
|
+
throw new Error(
|
|
2428
|
+
"Materialized view name cannot be the same as the target table name."
|
|
2429
|
+
);
|
|
2430
|
+
}
|
|
2431
|
+
this.name = options.materializedViewName;
|
|
2432
|
+
this.targetTable = targetTable;
|
|
2433
|
+
this.selectSql = selectStatement;
|
|
2434
|
+
this.sourceTables = options.selectTables.map((t) => t.name);
|
|
2435
|
+
const stack = new Error().stack;
|
|
2436
|
+
this.sourceFile = getSourceFileFromStack(stack);
|
|
2437
|
+
const materializedViews = getMooseInternal().materializedViews;
|
|
2438
|
+
if (!isClientOnlyMode() && materializedViews.has(this.name)) {
|
|
2439
|
+
throw new Error(`MaterializedView with name ${this.name} already exists`);
|
|
2440
|
+
}
|
|
2441
|
+
materializedViews.set(this.name, this);
|
|
2442
|
+
}
|
|
2443
|
+
};
|
|
2444
|
+
|
|
2392
2445
|
// src/dmv2/sdk/sqlResource.ts
|
|
2393
2446
|
var SqlResource = class {
|
|
2394
2447
|
/** @internal */
|
|
@@ -2443,66 +2496,18 @@ var SqlResource = class {
|
|
|
2443
2496
|
}
|
|
2444
2497
|
};
|
|
2445
2498
|
|
|
2446
|
-
// src/dmv2/sdk/materializedView.ts
|
|
2447
|
-
var requireTargetTableName = (tableName) => {
|
|
2448
|
-
if (typeof tableName === "string") {
|
|
2449
|
-
return tableName;
|
|
2450
|
-
} else {
|
|
2451
|
-
throw new Error("Name of targetTable is not specified.");
|
|
2452
|
-
}
|
|
2453
|
-
};
|
|
2454
|
-
var MaterializedView = class extends SqlResource {
|
|
2455
|
-
/** The target OlapTable instance where the materialized data is stored. */
|
|
2456
|
-
targetTable;
|
|
2457
|
-
constructor(options, targetSchema, targetColumns) {
|
|
2458
|
-
let selectStatement = options.selectStatement;
|
|
2459
|
-
if (typeof selectStatement !== "string") {
|
|
2460
|
-
selectStatement = toStaticQuery(selectStatement);
|
|
2461
|
-
}
|
|
2462
|
-
if (targetSchema === void 0 || targetColumns === void 0) {
|
|
2463
|
-
throw new Error(
|
|
2464
|
-
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
2465
|
-
);
|
|
2466
|
-
}
|
|
2467
|
-
const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
|
|
2468
|
-
requireTargetTableName(
|
|
2469
|
-
options.targetTable?.name ?? options.tableName
|
|
2470
|
-
),
|
|
2471
|
-
{
|
|
2472
|
-
orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
|
|
2473
|
-
engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
|
|
2474
|
-
},
|
|
2475
|
-
targetSchema,
|
|
2476
|
-
targetColumns
|
|
2477
|
-
);
|
|
2478
|
-
if (targetTable.name === options.materializedViewName) {
|
|
2479
|
-
throw new Error(
|
|
2480
|
-
"Materialized view name cannot be the same as the target table name."
|
|
2481
|
-
);
|
|
2482
|
-
}
|
|
2483
|
-
super(
|
|
2484
|
-
options.materializedViewName,
|
|
2485
|
-
[
|
|
2486
|
-
createMaterializedView({
|
|
2487
|
-
name: options.materializedViewName,
|
|
2488
|
-
destinationTable: targetTable.name,
|
|
2489
|
-
select: selectStatement
|
|
2490
|
-
})
|
|
2491
|
-
// Population is now handled automatically by Rust infrastructure
|
|
2492
|
-
// based on table engine type and whether this is a new or updated view
|
|
2493
|
-
],
|
|
2494
|
-
[dropView(options.materializedViewName)],
|
|
2495
|
-
{
|
|
2496
|
-
pullsDataFrom: options.selectTables,
|
|
2497
|
-
pushesDataTo: [targetTable]
|
|
2498
|
-
}
|
|
2499
|
-
);
|
|
2500
|
-
this.targetTable = targetTable;
|
|
2501
|
-
}
|
|
2502
|
-
};
|
|
2503
|
-
|
|
2504
2499
|
// src/dmv2/sdk/view.ts
|
|
2505
|
-
var View = class
|
|
2500
|
+
var View = class {
|
|
2501
|
+
/** @internal */
|
|
2502
|
+
kind = "CustomView";
|
|
2503
|
+
/** The name of the view */
|
|
2504
|
+
name;
|
|
2505
|
+
/** The SELECT SQL statement that defines the view */
|
|
2506
|
+
selectSql;
|
|
2507
|
+
/** Names of source tables/views that the SELECT reads from */
|
|
2508
|
+
sourceTables;
|
|
2509
|
+
/** @internal Source file path where this view was defined */
|
|
2510
|
+
sourceFile;
|
|
2506
2511
|
/**
|
|
2507
2512
|
* Creates a new View instance.
|
|
2508
2513
|
* @param name The name of the view to be created.
|
|
@@ -2513,17 +2518,16 @@ var View = class extends SqlResource {
|
|
|
2513
2518
|
if (typeof selectStatement !== "string") {
|
|
2514
2519
|
selectStatement = toStaticQuery(selectStatement);
|
|
2515
2520
|
}
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
{
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
);
|
|
2521
|
+
this.name = name;
|
|
2522
|
+
this.selectSql = selectStatement;
|
|
2523
|
+
this.sourceTables = baseTables.map((t) => t.name);
|
|
2524
|
+
const stack = new Error().stack;
|
|
2525
|
+
this.sourceFile = getSourceFileFromStack(stack);
|
|
2526
|
+
const customViews = getMooseInternal().customViews;
|
|
2527
|
+
if (!isClientOnlyMode() && customViews.has(this.name)) {
|
|
2528
|
+
throw new Error(`View with name ${this.name} already exists`);
|
|
2529
|
+
}
|
|
2530
|
+
customViews.set(this.name, this);
|
|
2527
2531
|
}
|
|
2528
2532
|
};
|
|
2529
2533
|
|