@514labs/moose-lib 0.6.264 → 0.6.266
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-Bqhjy4pn.d.ts → browserCompatible-CpjUXotI.d.ts} +1 -1
- package/dist/{browserCompatible-DTtKuO-Y.d.mts → browserCompatible-fk6xPzoB.d.mts} +1 -1
- package/dist/browserCompatible.d.mts +2 -2
- package/dist/browserCompatible.d.ts +2 -2
- package/dist/browserCompatible.js +31 -12
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +31 -12
- package/dist/browserCompatible.mjs.map +1 -1
- package/dist/compilerPlugin.js +43 -3
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +43 -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 +31 -12
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +31 -12
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-CQB6bk1i.d.mts → index-Dd3ZmpTq.d.mts} +25 -6
- package/dist/{index-CQB6bk1i.d.ts → index-Dd3ZmpTq.d.ts} +25 -6
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +31 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +31 -12
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +2 -1
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +2 -1
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/dmv2/index.mjs
CHANGED
|
@@ -434,6 +434,12 @@ var TypedBase = class {
|
|
|
434
434
|
validators;
|
|
435
435
|
/** Optional metadata for the resource, always present as an object. */
|
|
436
436
|
metadata;
|
|
437
|
+
/**
|
|
438
|
+
* Whether this resource allows extra fields beyond the defined columns.
|
|
439
|
+
* When true, extra fields in payloads are passed through to streaming functions.
|
|
440
|
+
* Injected by the compiler plugin when the type has an index signature.
|
|
441
|
+
*/
|
|
442
|
+
allowExtraFields;
|
|
437
443
|
/**
|
|
438
444
|
* @internal Constructor intended for internal use by subclasses and the compiler plugin.
|
|
439
445
|
* It expects the schema and columns to be provided, typically injected by the compiler.
|
|
@@ -442,8 +448,9 @@ var TypedBase = class {
|
|
|
442
448
|
* @param config The configuration object for the resource.
|
|
443
449
|
* @param schema The JSON schema for the resource's data type T (injected).
|
|
444
450
|
* @param columns The array of Column definitions for T (injected).
|
|
451
|
+
* @param allowExtraFields Whether extra fields are allowed (injected when type has index signature).
|
|
445
452
|
*/
|
|
446
|
-
constructor(name, config, schema, columns, validators) {
|
|
453
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
447
454
|
if (schema === void 0 || columns === void 0) {
|
|
448
455
|
throw new Error(
|
|
449
456
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
@@ -459,6 +466,7 @@ var TypedBase = class {
|
|
|
459
466
|
this.name = name;
|
|
460
467
|
this.config = config;
|
|
461
468
|
this.validators = validators;
|
|
469
|
+
this.allowExtraFields = allowExtraFields ?? false;
|
|
462
470
|
this.metadata = config?.metadata ? { ...config.metadata } : {};
|
|
463
471
|
const stack = new Error().stack;
|
|
464
472
|
if (stack) {
|
|
@@ -1430,8 +1438,8 @@ var Stream = class extends TypedBase {
|
|
|
1430
1438
|
_memoizedProducer;
|
|
1431
1439
|
/** @internal Hash of the configuration used to create the memoized Kafka producer */
|
|
1432
1440
|
_kafkaConfigHash;
|
|
1433
|
-
constructor(name, config, schema, columns) {
|
|
1434
|
-
super(name, config ?? {}, schema, columns);
|
|
1441
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1442
|
+
super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
|
|
1435
1443
|
const streams = getMooseInternal().streams;
|
|
1436
1444
|
if (streams.has(name)) {
|
|
1437
1445
|
throw new Error(`Stream with name ${name} already exists`);
|
|
@@ -1687,7 +1695,7 @@ var DeadLetterQueue = class extends Stream {
|
|
|
1687
1695
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
1688
1696
|
);
|
|
1689
1697
|
}
|
|
1690
|
-
super(name, config ?? {}, dlqSchema, dlqColumns);
|
|
1698
|
+
super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
|
|
1691
1699
|
this.typeGuard = typeGuard;
|
|
1692
1700
|
getMooseInternal().streams.set(name, this);
|
|
1693
1701
|
}
|
|
@@ -1853,8 +1861,8 @@ var Workflow = class {
|
|
|
1853
1861
|
|
|
1854
1862
|
// src/dmv2/sdk/ingestApi.ts
|
|
1855
1863
|
var IngestApi = class extends TypedBase {
|
|
1856
|
-
constructor(name, config, schema, columns) {
|
|
1857
|
-
super(name, config, schema, columns);
|
|
1864
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1865
|
+
super(name, config, schema, columns, void 0, allowExtraFields);
|
|
1858
1866
|
const ingestApis = getMooseInternal().ingestApis;
|
|
1859
1867
|
if (ingestApis.has(name)) {
|
|
1860
1868
|
throw new Error(`Ingest API with name ${name} already exists`);
|
|
@@ -1993,8 +2001,8 @@ var IngestPipeline = class extends TypedBase {
|
|
|
1993
2001
|
ingestApi;
|
|
1994
2002
|
/** The dead letter queue of the pipeline, if configured. */
|
|
1995
2003
|
deadLetterQueue;
|
|
1996
|
-
constructor(name, config, schema, columns, validators) {
|
|
1997
|
-
super(name, config, schema, columns, validators);
|
|
2004
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
2005
|
+
super(name, config, schema, columns, validators, allowExtraFields);
|
|
1998
2006
|
if (config.ingest !== void 0) {
|
|
1999
2007
|
console.warn(
|
|
2000
2008
|
"\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
|
|
@@ -2006,6 +2014,7 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2006
2014
|
if (config.table) {
|
|
2007
2015
|
const tableConfig = typeof config.table === "object" ? {
|
|
2008
2016
|
...config.table,
|
|
2017
|
+
lifeCycle: config.table.lifeCycle ?? config.lifeCycle,
|
|
2009
2018
|
...config.version && { version: config.version }
|
|
2010
2019
|
} : {
|
|
2011
2020
|
lifeCycle: config.lifeCycle,
|
|
@@ -2023,7 +2032,10 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2023
2032
|
if (config.deadLetterQueue) {
|
|
2024
2033
|
const streamConfig = {
|
|
2025
2034
|
destination: void 0,
|
|
2026
|
-
...typeof config.deadLetterQueue === "object" ?
|
|
2035
|
+
...typeof config.deadLetterQueue === "object" ? {
|
|
2036
|
+
...config.deadLetterQueue,
|
|
2037
|
+
lifeCycle: config.deadLetterQueue.lifeCycle ?? config.lifeCycle
|
|
2038
|
+
} : { lifeCycle: config.lifeCycle },
|
|
2027
2039
|
...config.version && { version: config.version }
|
|
2028
2040
|
};
|
|
2029
2041
|
this.deadLetterQueue = new DeadLetterQueue(
|
|
@@ -2036,14 +2048,19 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2036
2048
|
const streamConfig = {
|
|
2037
2049
|
destination: this.table,
|
|
2038
2050
|
defaultDeadLetterQueue: this.deadLetterQueue,
|
|
2039
|
-
...typeof config.stream === "object" ?
|
|
2051
|
+
...typeof config.stream === "object" ? {
|
|
2052
|
+
...config.stream,
|
|
2053
|
+
lifeCycle: config.stream.lifeCycle ?? config.lifeCycle
|
|
2054
|
+
} : { lifeCycle: config.lifeCycle },
|
|
2040
2055
|
...config.version && { version: config.version }
|
|
2041
2056
|
};
|
|
2042
2057
|
this.stream = new Stream(
|
|
2043
2058
|
name,
|
|
2044
2059
|
streamConfig,
|
|
2045
2060
|
this.schema,
|
|
2046
|
-
this.columnArray
|
|
2061
|
+
this.columnArray,
|
|
2062
|
+
void 0,
|
|
2063
|
+
this.allowExtraFields
|
|
2047
2064
|
);
|
|
2048
2065
|
this.stream.pipelineParent = this;
|
|
2049
2066
|
}
|
|
@@ -2063,7 +2080,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2063
2080
|
name,
|
|
2064
2081
|
ingestConfig,
|
|
2065
2082
|
this.schema,
|
|
2066
|
-
this.columnArray
|
|
2083
|
+
this.columnArray,
|
|
2084
|
+
void 0,
|
|
2085
|
+
this.allowExtraFields
|
|
2067
2086
|
);
|
|
2068
2087
|
this.ingestApi.pipelineParent = this;
|
|
2069
2088
|
}
|