@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/index.mjs
CHANGED
|
@@ -440,6 +440,12 @@ var TypedBase = class {
|
|
|
440
440
|
validators;
|
|
441
441
|
/** Optional metadata for the resource, always present as an object. */
|
|
442
442
|
metadata;
|
|
443
|
+
/**
|
|
444
|
+
* Whether this resource allows extra fields beyond the defined columns.
|
|
445
|
+
* When true, extra fields in payloads are passed through to streaming functions.
|
|
446
|
+
* Injected by the compiler plugin when the type has an index signature.
|
|
447
|
+
*/
|
|
448
|
+
allowExtraFields;
|
|
443
449
|
/**
|
|
444
450
|
* @internal Constructor intended for internal use by subclasses and the compiler plugin.
|
|
445
451
|
* It expects the schema and columns to be provided, typically injected by the compiler.
|
|
@@ -448,8 +454,9 @@ var TypedBase = class {
|
|
|
448
454
|
* @param config The configuration object for the resource.
|
|
449
455
|
* @param schema The JSON schema for the resource's data type T (injected).
|
|
450
456
|
* @param columns The array of Column definitions for T (injected).
|
|
457
|
+
* @param allowExtraFields Whether extra fields are allowed (injected when type has index signature).
|
|
451
458
|
*/
|
|
452
|
-
constructor(name, config, schema, columns, validators) {
|
|
459
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
453
460
|
if (schema === void 0 || columns === void 0) {
|
|
454
461
|
throw new Error(
|
|
455
462
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
@@ -465,6 +472,7 @@ var TypedBase = class {
|
|
|
465
472
|
this.name = name;
|
|
466
473
|
this.config = config;
|
|
467
474
|
this.validators = validators;
|
|
475
|
+
this.allowExtraFields = allowExtraFields ?? false;
|
|
468
476
|
this.metadata = config?.metadata ? { ...config.metadata } : {};
|
|
469
477
|
const stack = new Error().stack;
|
|
470
478
|
if (stack) {
|
|
@@ -1549,8 +1557,8 @@ var Stream = class extends TypedBase {
|
|
|
1549
1557
|
_memoizedProducer;
|
|
1550
1558
|
/** @internal Hash of the configuration used to create the memoized Kafka producer */
|
|
1551
1559
|
_kafkaConfigHash;
|
|
1552
|
-
constructor(name, config, schema, columns) {
|
|
1553
|
-
super(name, config ?? {}, schema, columns);
|
|
1560
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1561
|
+
super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
|
|
1554
1562
|
const streams = getMooseInternal().streams;
|
|
1555
1563
|
if (streams.has(name)) {
|
|
1556
1564
|
throw new Error(`Stream with name ${name} already exists`);
|
|
@@ -1806,7 +1814,7 @@ var DeadLetterQueue = class extends Stream {
|
|
|
1806
1814
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
1807
1815
|
);
|
|
1808
1816
|
}
|
|
1809
|
-
super(name, config ?? {}, dlqSchema, dlqColumns);
|
|
1817
|
+
super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
|
|
1810
1818
|
this.typeGuard = typeGuard;
|
|
1811
1819
|
getMooseInternal().streams.set(name, this);
|
|
1812
1820
|
}
|
|
@@ -1972,8 +1980,8 @@ var Workflow = class {
|
|
|
1972
1980
|
|
|
1973
1981
|
// src/dmv2/sdk/ingestApi.ts
|
|
1974
1982
|
var IngestApi = class extends TypedBase {
|
|
1975
|
-
constructor(name, config, schema, columns) {
|
|
1976
|
-
super(name, config, schema, columns);
|
|
1983
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1984
|
+
super(name, config, schema, columns, void 0, allowExtraFields);
|
|
1977
1985
|
const ingestApis = getMooseInternal().ingestApis;
|
|
1978
1986
|
if (ingestApis.has(name)) {
|
|
1979
1987
|
throw new Error(`Ingest API with name ${name} already exists`);
|
|
@@ -2112,8 +2120,8 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2112
2120
|
ingestApi;
|
|
2113
2121
|
/** The dead letter queue of the pipeline, if configured. */
|
|
2114
2122
|
deadLetterQueue;
|
|
2115
|
-
constructor(name, config, schema, columns, validators) {
|
|
2116
|
-
super(name, config, schema, columns, validators);
|
|
2123
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
2124
|
+
super(name, config, schema, columns, validators, allowExtraFields);
|
|
2117
2125
|
if (config.ingest !== void 0) {
|
|
2118
2126
|
console.warn(
|
|
2119
2127
|
"\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
|
|
@@ -2125,6 +2133,7 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2125
2133
|
if (config.table) {
|
|
2126
2134
|
const tableConfig = typeof config.table === "object" ? {
|
|
2127
2135
|
...config.table,
|
|
2136
|
+
lifeCycle: config.table.lifeCycle ?? config.lifeCycle,
|
|
2128
2137
|
...config.version && { version: config.version }
|
|
2129
2138
|
} : {
|
|
2130
2139
|
lifeCycle: config.lifeCycle,
|
|
@@ -2142,7 +2151,10 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2142
2151
|
if (config.deadLetterQueue) {
|
|
2143
2152
|
const streamConfig = {
|
|
2144
2153
|
destination: void 0,
|
|
2145
|
-
...typeof config.deadLetterQueue === "object" ?
|
|
2154
|
+
...typeof config.deadLetterQueue === "object" ? {
|
|
2155
|
+
...config.deadLetterQueue,
|
|
2156
|
+
lifeCycle: config.deadLetterQueue.lifeCycle ?? config.lifeCycle
|
|
2157
|
+
} : { lifeCycle: config.lifeCycle },
|
|
2146
2158
|
...config.version && { version: config.version }
|
|
2147
2159
|
};
|
|
2148
2160
|
this.deadLetterQueue = new DeadLetterQueue(
|
|
@@ -2155,14 +2167,19 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2155
2167
|
const streamConfig = {
|
|
2156
2168
|
destination: this.table,
|
|
2157
2169
|
defaultDeadLetterQueue: this.deadLetterQueue,
|
|
2158
|
-
...typeof config.stream === "object" ?
|
|
2170
|
+
...typeof config.stream === "object" ? {
|
|
2171
|
+
...config.stream,
|
|
2172
|
+
lifeCycle: config.stream.lifeCycle ?? config.lifeCycle
|
|
2173
|
+
} : { lifeCycle: config.lifeCycle },
|
|
2159
2174
|
...config.version && { version: config.version }
|
|
2160
2175
|
};
|
|
2161
2176
|
this.stream = new Stream(
|
|
2162
2177
|
name,
|
|
2163
2178
|
streamConfig,
|
|
2164
2179
|
this.schema,
|
|
2165
|
-
this.columnArray
|
|
2180
|
+
this.columnArray,
|
|
2181
|
+
void 0,
|
|
2182
|
+
this.allowExtraFields
|
|
2166
2183
|
);
|
|
2167
2184
|
this.stream.pipelineParent = this;
|
|
2168
2185
|
}
|
|
@@ -2182,7 +2199,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2182
2199
|
name,
|
|
2183
2200
|
ingestConfig,
|
|
2184
2201
|
this.schema,
|
|
2185
|
-
this.columnArray
|
|
2202
|
+
this.columnArray,
|
|
2203
|
+
void 0,
|
|
2204
|
+
this.allowExtraFields
|
|
2186
2205
|
);
|
|
2187
2206
|
this.ingestApi.pipelineParent = this;
|
|
2188
2207
|
}
|