@514labs/moose-lib 0.6.239-ci-1-ga99426cc → 0.6.239-ci-4-g4348a9e3
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-CMLITD0_.d.ts → browserCompatible-B3DCF1U4.d.ts} +1 -1
- package/dist/{browserCompatible-BRa8sgXw.d.mts → browserCompatible-BonAvoqJ.d.mts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +24 -16
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +24 -16
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +22 -3
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +22 -3
- package/dist/compilerPlugin.mjs.map +1 -1
- package/dist/dataModels/toDataModels.js +2 -2
- package/dist/dataModels/toDataModels.js.map +1 -1
- package/dist/dataModels/toDataModels.mjs +2 -2
- package/dist/dataModels/toDataModels.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 +24 -16
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +24 -16
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-BG2HP0xG.d.mts → index-DsCMbhN3.d.mts} +13 -4
- package/dist/{index-BG2HP0xG.d.ts → index-DsCMbhN3.d.ts} +13 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +24 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -13
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +2 -2
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +2 -2
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -390,6 +390,12 @@ var TypedBase = class {
|
|
|
390
390
|
validators;
|
|
391
391
|
/** Optional metadata for the resource, always present as an object. */
|
|
392
392
|
metadata;
|
|
393
|
+
/**
|
|
394
|
+
* Whether this resource allows extra fields beyond the defined columns.
|
|
395
|
+
* When true, extra fields in payloads are passed through to streaming functions.
|
|
396
|
+
* Injected by the compiler plugin when the type has an index signature.
|
|
397
|
+
*/
|
|
398
|
+
allowExtraFields;
|
|
393
399
|
/**
|
|
394
400
|
* @internal Constructor intended for internal use by subclasses and the compiler plugin.
|
|
395
401
|
* It expects the schema and columns to be provided, typically injected by the compiler.
|
|
@@ -398,8 +404,9 @@ var TypedBase = class {
|
|
|
398
404
|
* @param config The configuration object for the resource.
|
|
399
405
|
* @param schema The JSON schema for the resource's data type T (injected).
|
|
400
406
|
* @param columns The array of Column definitions for T (injected).
|
|
407
|
+
* @param allowExtraFields Whether extra fields are allowed (injected when type has index signature).
|
|
401
408
|
*/
|
|
402
|
-
constructor(name, config, schema, columns, validators) {
|
|
409
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
403
410
|
if (schema === void 0 || columns === void 0) {
|
|
404
411
|
throw new Error(
|
|
405
412
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
@@ -415,6 +422,7 @@ var TypedBase = class {
|
|
|
415
422
|
this.name = name;
|
|
416
423
|
this.config = config;
|
|
417
424
|
this.validators = validators;
|
|
425
|
+
this.allowExtraFields = allowExtraFields ?? false;
|
|
418
426
|
this.metadata = config?.metadata ? { ...config.metadata } : {};
|
|
419
427
|
const stack = new Error().stack;
|
|
420
428
|
if (stack) {
|
|
@@ -623,7 +631,6 @@ init_commons();
|
|
|
623
631
|
function getSourceDir() {
|
|
624
632
|
return process2.env.MOOSE_SOURCE_DIR || "app";
|
|
625
633
|
}
|
|
626
|
-
var isClientOnlyMode = process2.env.MOOSE_CLIENT_ONLY === "true";
|
|
627
634
|
var moose_internal = {
|
|
628
635
|
tables: /* @__PURE__ */ new Map(),
|
|
629
636
|
streams: /* @__PURE__ */ new Map(),
|
|
@@ -820,7 +827,7 @@ var OlapTable = class extends TypedBase {
|
|
|
820
827
|
this.name = name;
|
|
821
828
|
const tables = getMooseInternal().tables;
|
|
822
829
|
const registryKey = this.config.version ? `${name}_${this.config.version}` : name;
|
|
823
|
-
if (
|
|
830
|
+
if (tables.has(registryKey)) {
|
|
824
831
|
throw new Error(
|
|
825
832
|
`OlapTable with name ${name} and version ${config?.version ?? "unversioned"} already exists`
|
|
826
833
|
);
|
|
@@ -1493,8 +1500,8 @@ var Stream = class extends TypedBase {
|
|
|
1493
1500
|
_memoizedProducer;
|
|
1494
1501
|
/** @internal Hash of the configuration used to create the memoized Kafka producer */
|
|
1495
1502
|
_kafkaConfigHash;
|
|
1496
|
-
constructor(name, config, schema, columns) {
|
|
1497
|
-
super(name, config ?? {}, schema, columns);
|
|
1503
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1504
|
+
super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
|
|
1498
1505
|
const streams = getMooseInternal().streams;
|
|
1499
1506
|
if (streams.has(name)) {
|
|
1500
1507
|
throw new Error(`Stream with name ${name} already exists`);
|
|
@@ -1746,7 +1753,7 @@ var DeadLetterQueue = class extends Stream {
|
|
|
1746
1753
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
1747
1754
|
);
|
|
1748
1755
|
}
|
|
1749
|
-
super(name, config ?? {}, dlqSchema, dlqColumns);
|
|
1756
|
+
super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
|
|
1750
1757
|
this.typeGuard = typeGuard;
|
|
1751
1758
|
getMooseInternal().streams.set(name, this);
|
|
1752
1759
|
}
|
|
@@ -1912,8 +1919,8 @@ var Workflow = class {
|
|
|
1912
1919
|
|
|
1913
1920
|
// src/dmv2/sdk/ingestApi.ts
|
|
1914
1921
|
var IngestApi = class extends TypedBase {
|
|
1915
|
-
constructor(name, config, schema, columns) {
|
|
1916
|
-
super(name, config, schema, columns);
|
|
1922
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1923
|
+
super(name, config, schema, columns, void 0, allowExtraFields);
|
|
1917
1924
|
const ingestApis = getMooseInternal().ingestApis;
|
|
1918
1925
|
if (ingestApis.has(name)) {
|
|
1919
1926
|
throw new Error(`Ingest API with name ${name} already exists`);
|
|
@@ -2052,8 +2059,8 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2052
2059
|
ingestApi;
|
|
2053
2060
|
/** The dead letter queue of the pipeline, if configured. */
|
|
2054
2061
|
deadLetterQueue;
|
|
2055
|
-
constructor(name, config, schema, columns, validators) {
|
|
2056
|
-
super(name, config, schema, columns, validators);
|
|
2062
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
2063
|
+
super(name, config, schema, columns, validators, allowExtraFields);
|
|
2057
2064
|
if (config.ingest !== void 0) {
|
|
2058
2065
|
console.warn(
|
|
2059
2066
|
"\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
|
|
@@ -2102,7 +2109,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2102
2109
|
name,
|
|
2103
2110
|
streamConfig,
|
|
2104
2111
|
this.schema,
|
|
2105
|
-
this.columnArray
|
|
2112
|
+
this.columnArray,
|
|
2113
|
+
void 0,
|
|
2114
|
+
this.allowExtraFields
|
|
2106
2115
|
);
|
|
2107
2116
|
this.stream.pipelineParent = this;
|
|
2108
2117
|
}
|
|
@@ -2122,7 +2131,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2122
2131
|
name,
|
|
2123
2132
|
ingestConfig,
|
|
2124
2133
|
this.schema,
|
|
2125
|
-
this.columnArray
|
|
2134
|
+
this.columnArray,
|
|
2135
|
+
void 0,
|
|
2136
|
+
this.allowExtraFields
|
|
2126
2137
|
);
|
|
2127
2138
|
this.ingestApi.pipelineParent = this;
|
|
2128
2139
|
}
|
|
@@ -2296,7 +2307,7 @@ var SqlResource = class {
|
|
|
2296
2307
|
*/
|
|
2297
2308
|
constructor(name, setup, teardown, options) {
|
|
2298
2309
|
const sqlResources = getMooseInternal().sqlResources;
|
|
2299
|
-
if (
|
|
2310
|
+
if (sqlResources.has(name)) {
|
|
2300
2311
|
throw new Error(`SqlResource with name ${name} already exists`);
|
|
2301
2312
|
}
|
|
2302
2313
|
sqlResources.set(name, this);
|