@514labs/moose-lib 0.6.262-ci-2-g1c866068 → 0.6.262-ci-7-g8a83699f
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-CC6Jamxn.d.ts → browserCompatible-BpwCKgGF.d.ts} +1 -1
- package/dist/{browserCompatible-GsBQtLKo.d.mts → browserCompatible-CDqMXtd_.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-B1HsstjQ.d.mts → index-B2jILcTY.d.mts} +56 -36
- package/dist/{index-B1HsstjQ.d.ts → index-B2jILcTY.d.ts} +56 -36
- 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-B2jILcTY.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-CDqMXtd_.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-B2jILcTY.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-BpwCKgGF.js';
|
|
3
3
|
import 'typia';
|
|
4
4
|
import 'typia/src/schemas/json/IJsonSchemaCollection';
|
|
5
5
|
import 'node:stream';
|
|
@@ -667,16 +667,6 @@ function emptyIfUndefined(value) {
|
|
|
667
667
|
return value === void 0 ? "" : value;
|
|
668
668
|
}
|
|
669
669
|
|
|
670
|
-
// src/blocks/helpers.ts
|
|
671
|
-
function dropView(name) {
|
|
672
|
-
return `DROP VIEW IF EXISTS ${quoteIdentifier(name)}`.trim();
|
|
673
|
-
}
|
|
674
|
-
function createMaterializedView(options) {
|
|
675
|
-
return `CREATE MATERIALIZED VIEW IF NOT EXISTS ${quoteIdentifier(options.name)}
|
|
676
|
-
TO ${quoteIdentifier(options.destinationTable)}
|
|
677
|
-
AS ${options.select}`.trim();
|
|
678
|
-
}
|
|
679
|
-
|
|
680
670
|
// src/dmv2/internal.ts
|
|
681
671
|
var import_process = __toESM(require("process"));
|
|
682
672
|
|
|
@@ -727,7 +717,9 @@ var moose_internal = {
|
|
|
727
717
|
apis: /* @__PURE__ */ new Map(),
|
|
728
718
|
sqlResources: /* @__PURE__ */ new Map(),
|
|
729
719
|
workflows: /* @__PURE__ */ new Map(),
|
|
730
|
-
webApps: /* @__PURE__ */ new Map()
|
|
720
|
+
webApps: /* @__PURE__ */ new Map(),
|
|
721
|
+
materializedViews: /* @__PURE__ */ new Map(),
|
|
722
|
+
customViews: /* @__PURE__ */ new Map()
|
|
731
723
|
};
|
|
732
724
|
var defaultRetentionPeriod = 60 * 60 * 24 * 7;
|
|
733
725
|
var getMooseInternal = () => globalThis.moose_internal;
|
|
@@ -2343,6 +2335,67 @@ var ETLPipeline = class {
|
|
|
2343
2335
|
}
|
|
2344
2336
|
};
|
|
2345
2337
|
|
|
2338
|
+
// src/dmv2/sdk/materializedView.ts
|
|
2339
|
+
var requireTargetTableName = (tableName) => {
|
|
2340
|
+
if (typeof tableName === "string") {
|
|
2341
|
+
return tableName;
|
|
2342
|
+
} else {
|
|
2343
|
+
throw new Error("Name of targetTable is not specified.");
|
|
2344
|
+
}
|
|
2345
|
+
};
|
|
2346
|
+
var MaterializedView = class {
|
|
2347
|
+
/** @internal */
|
|
2348
|
+
kind = "MaterializedView";
|
|
2349
|
+
/** The name of the materialized view */
|
|
2350
|
+
name;
|
|
2351
|
+
/** The target OlapTable instance where the materialized data is stored. */
|
|
2352
|
+
targetTable;
|
|
2353
|
+
/** The SELECT SQL statement */
|
|
2354
|
+
selectSql;
|
|
2355
|
+
/** Names of source tables that the SELECT reads from */
|
|
2356
|
+
sourceTables;
|
|
2357
|
+
/** @internal Source file path where this MV was defined */
|
|
2358
|
+
sourceFile;
|
|
2359
|
+
constructor(options, targetSchema, targetColumns) {
|
|
2360
|
+
let selectStatement = options.selectStatement;
|
|
2361
|
+
if (typeof selectStatement !== "string") {
|
|
2362
|
+
selectStatement = toStaticQuery(selectStatement);
|
|
2363
|
+
}
|
|
2364
|
+
if (targetSchema === void 0 || targetColumns === void 0) {
|
|
2365
|
+
throw new Error(
|
|
2366
|
+
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
2367
|
+
);
|
|
2368
|
+
}
|
|
2369
|
+
const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
|
|
2370
|
+
requireTargetTableName(
|
|
2371
|
+
options.targetTable?.name ?? options.tableName
|
|
2372
|
+
),
|
|
2373
|
+
{
|
|
2374
|
+
orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
|
|
2375
|
+
engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
|
|
2376
|
+
},
|
|
2377
|
+
targetSchema,
|
|
2378
|
+
targetColumns
|
|
2379
|
+
);
|
|
2380
|
+
if (targetTable.name === options.materializedViewName) {
|
|
2381
|
+
throw new Error(
|
|
2382
|
+
"Materialized view name cannot be the same as the target table name."
|
|
2383
|
+
);
|
|
2384
|
+
}
|
|
2385
|
+
this.name = options.materializedViewName;
|
|
2386
|
+
this.targetTable = targetTable;
|
|
2387
|
+
this.selectSql = selectStatement;
|
|
2388
|
+
this.sourceTables = options.selectTables.map((t) => t.name);
|
|
2389
|
+
const stack = new Error().stack;
|
|
2390
|
+
this.sourceFile = getSourceFileFromStack(stack);
|
|
2391
|
+
const materializedViews = getMooseInternal().materializedViews;
|
|
2392
|
+
if (!isClientOnlyMode() && materializedViews.has(this.name)) {
|
|
2393
|
+
throw new Error(`MaterializedView with name ${this.name} already exists`);
|
|
2394
|
+
}
|
|
2395
|
+
materializedViews.set(this.name, this);
|
|
2396
|
+
}
|
|
2397
|
+
};
|
|
2398
|
+
|
|
2346
2399
|
// src/dmv2/sdk/sqlResource.ts
|
|
2347
2400
|
var SqlResource = class {
|
|
2348
2401
|
/** @internal */
|
|
@@ -2388,66 +2441,18 @@ var SqlResource = class {
|
|
|
2388
2441
|
}
|
|
2389
2442
|
};
|
|
2390
2443
|
|
|
2391
|
-
// src/dmv2/sdk/materializedView.ts
|
|
2392
|
-
var requireTargetTableName = (tableName) => {
|
|
2393
|
-
if (typeof tableName === "string") {
|
|
2394
|
-
return tableName;
|
|
2395
|
-
} else {
|
|
2396
|
-
throw new Error("Name of targetTable is not specified.");
|
|
2397
|
-
}
|
|
2398
|
-
};
|
|
2399
|
-
var MaterializedView = class extends SqlResource {
|
|
2400
|
-
/** The target OlapTable instance where the materialized data is stored. */
|
|
2401
|
-
targetTable;
|
|
2402
|
-
constructor(options, targetSchema, targetColumns) {
|
|
2403
|
-
let selectStatement = options.selectStatement;
|
|
2404
|
-
if (typeof selectStatement !== "string") {
|
|
2405
|
-
selectStatement = toStaticQuery(selectStatement);
|
|
2406
|
-
}
|
|
2407
|
-
if (targetSchema === void 0 || targetColumns === void 0) {
|
|
2408
|
-
throw new Error(
|
|
2409
|
-
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
2410
|
-
);
|
|
2411
|
-
}
|
|
2412
|
-
const targetTable = options.targetTable instanceof OlapTable ? options.targetTable : new OlapTable(
|
|
2413
|
-
requireTargetTableName(
|
|
2414
|
-
options.targetTable?.name ?? options.tableName
|
|
2415
|
-
),
|
|
2416
|
-
{
|
|
2417
|
-
orderByFields: options.targetTable?.orderByFields ?? options.orderByFields,
|
|
2418
|
-
engine: options.targetTable?.engine ?? options.engine ?? "MergeTree" /* MergeTree */
|
|
2419
|
-
},
|
|
2420
|
-
targetSchema,
|
|
2421
|
-
targetColumns
|
|
2422
|
-
);
|
|
2423
|
-
if (targetTable.name === options.materializedViewName) {
|
|
2424
|
-
throw new Error(
|
|
2425
|
-
"Materialized view name cannot be the same as the target table name."
|
|
2426
|
-
);
|
|
2427
|
-
}
|
|
2428
|
-
super(
|
|
2429
|
-
options.materializedViewName,
|
|
2430
|
-
[
|
|
2431
|
-
createMaterializedView({
|
|
2432
|
-
name: options.materializedViewName,
|
|
2433
|
-
destinationTable: targetTable.name,
|
|
2434
|
-
select: selectStatement
|
|
2435
|
-
})
|
|
2436
|
-
// Population is now handled automatically by Rust infrastructure
|
|
2437
|
-
// based on table engine type and whether this is a new or updated view
|
|
2438
|
-
],
|
|
2439
|
-
[dropView(options.materializedViewName)],
|
|
2440
|
-
{
|
|
2441
|
-
pullsDataFrom: options.selectTables,
|
|
2442
|
-
pushesDataTo: [targetTable]
|
|
2443
|
-
}
|
|
2444
|
-
);
|
|
2445
|
-
this.targetTable = targetTable;
|
|
2446
|
-
}
|
|
2447
|
-
};
|
|
2448
|
-
|
|
2449
2444
|
// src/dmv2/sdk/view.ts
|
|
2450
|
-
var View = class
|
|
2445
|
+
var View = class {
|
|
2446
|
+
/** @internal */
|
|
2447
|
+
kind = "CustomView";
|
|
2448
|
+
/** The name of the view */
|
|
2449
|
+
name;
|
|
2450
|
+
/** The SELECT SQL statement that defines the view */
|
|
2451
|
+
selectSql;
|
|
2452
|
+
/** Names of source tables/views that the SELECT reads from */
|
|
2453
|
+
sourceTables;
|
|
2454
|
+
/** @internal Source file path where this view was defined */
|
|
2455
|
+
sourceFile;
|
|
2451
2456
|
/**
|
|
2452
2457
|
* Creates a new View instance.
|
|
2453
2458
|
* @param name The name of the view to be created.
|
|
@@ -2458,17 +2463,16 @@ var View = class extends SqlResource {
|
|
|
2458
2463
|
if (typeof selectStatement !== "string") {
|
|
2459
2464
|
selectStatement = toStaticQuery(selectStatement);
|
|
2460
2465
|
}
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
2468
|
-
{
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
);
|
|
2466
|
+
this.name = name;
|
|
2467
|
+
this.selectSql = selectStatement;
|
|
2468
|
+
this.sourceTables = baseTables.map((t) => t.name);
|
|
2469
|
+
const stack = new Error().stack;
|
|
2470
|
+
this.sourceFile = getSourceFileFromStack(stack);
|
|
2471
|
+
const customViews = getMooseInternal().customViews;
|
|
2472
|
+
if (!isClientOnlyMode() && customViews.has(this.name)) {
|
|
2473
|
+
throw new Error(`View with name ${this.name} already exists`);
|
|
2474
|
+
}
|
|
2475
|
+
customViews.set(this.name, this);
|
|
2472
2476
|
}
|
|
2473
2477
|
};
|
|
2474
2478
|
|