@514labs/moose-lib 0.6.262 → 0.6.263-ci-11-g40393f0d
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-CpjUXotI.d.ts} +1 -1
- package/dist/{browserCompatible-GsBQtLKo.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 +60 -12
- package/dist/browserCompatible.js.map +1 -1
- package/dist/browserCompatible.mjs +60 -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 +60 -12
- package/dist/dmv2/index.js.map +1 -1
- package/dist/dmv2/index.mjs +60 -12
- package/dist/dmv2/index.mjs.map +1 -1
- package/dist/{index-B1HsstjQ.d.mts → index-Dd3ZmpTq.d.mts} +29 -6
- package/dist/{index-B1HsstjQ.d.ts → index-Dd3ZmpTq.d.ts} +29 -6
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +60 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -12
- package/dist/index.mjs.map +1 -1
- package/dist/moose-runner.js +4 -1
- package/dist/moose-runner.js.map +1 -1
- package/dist/moose-runner.mjs +4 -1
- package/dist/moose-runner.mjs.map +1 -1
- package/package.json +1 -1
package/dist/dmv2/index.mjs
CHANGED
|
@@ -387,8 +387,35 @@ function getSourceFileInfo(stack) {
|
|
|
387
387
|
}
|
|
388
388
|
return {};
|
|
389
389
|
}
|
|
390
|
+
function getSourceLocationFromStack(stack) {
|
|
391
|
+
if (!stack) return void 0;
|
|
392
|
+
const lines = stack.split("\n");
|
|
393
|
+
for (const line of lines.slice(1)) {
|
|
394
|
+
if (shouldSkipStackLine(line)) {
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
const v8Match = line.match(/at\s+(?:.*?\s+\()?(.+):(\d+):(\d+)\)?/);
|
|
398
|
+
if (v8Match) {
|
|
399
|
+
return {
|
|
400
|
+
file: v8Match[1],
|
|
401
|
+
line: parseInt(v8Match[2], 10),
|
|
402
|
+
column: parseInt(v8Match[3], 10)
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
const smMatch = line.match(/(?:.*@)?(.+):(\d+):(\d+)/);
|
|
406
|
+
if (smMatch) {
|
|
407
|
+
return {
|
|
408
|
+
file: smMatch[1],
|
|
409
|
+
line: parseInt(smMatch[2], 10),
|
|
410
|
+
column: parseInt(smMatch[3], 10)
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
return void 0;
|
|
415
|
+
}
|
|
390
416
|
function getSourceFileFromStack(stack) {
|
|
391
|
-
|
|
417
|
+
const location = getSourceLocationFromStack(stack);
|
|
418
|
+
return location?.file;
|
|
392
419
|
}
|
|
393
420
|
|
|
394
421
|
// src/dmv2/typedBase.ts
|
|
@@ -407,6 +434,12 @@ var TypedBase = class {
|
|
|
407
434
|
validators;
|
|
408
435
|
/** Optional metadata for the resource, always present as an object. */
|
|
409
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;
|
|
410
443
|
/**
|
|
411
444
|
* @internal Constructor intended for internal use by subclasses and the compiler plugin.
|
|
412
445
|
* It expects the schema and columns to be provided, typically injected by the compiler.
|
|
@@ -415,8 +448,9 @@ var TypedBase = class {
|
|
|
415
448
|
* @param config The configuration object for the resource.
|
|
416
449
|
* @param schema The JSON schema for the resource's data type T (injected).
|
|
417
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).
|
|
418
452
|
*/
|
|
419
|
-
constructor(name, config, schema, columns, validators) {
|
|
453
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
420
454
|
if (schema === void 0 || columns === void 0) {
|
|
421
455
|
throw new Error(
|
|
422
456
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
@@ -432,6 +466,7 @@ var TypedBase = class {
|
|
|
432
466
|
this.name = name;
|
|
433
467
|
this.config = config;
|
|
434
468
|
this.validators = validators;
|
|
469
|
+
this.allowExtraFields = allowExtraFields ?? false;
|
|
435
470
|
this.metadata = config?.metadata ? { ...config.metadata } : {};
|
|
436
471
|
const stack = new Error().stack;
|
|
437
472
|
if (stack) {
|
|
@@ -1403,8 +1438,8 @@ var Stream = class extends TypedBase {
|
|
|
1403
1438
|
_memoizedProducer;
|
|
1404
1439
|
/** @internal Hash of the configuration used to create the memoized Kafka producer */
|
|
1405
1440
|
_kafkaConfigHash;
|
|
1406
|
-
constructor(name, config, schema, columns) {
|
|
1407
|
-
super(name, config ?? {}, schema, columns);
|
|
1441
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1442
|
+
super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
|
|
1408
1443
|
const streams = getMooseInternal().streams;
|
|
1409
1444
|
if (streams.has(name)) {
|
|
1410
1445
|
throw new Error(`Stream with name ${name} already exists`);
|
|
@@ -1660,7 +1695,7 @@ var DeadLetterQueue = class extends Stream {
|
|
|
1660
1695
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
1661
1696
|
);
|
|
1662
1697
|
}
|
|
1663
|
-
super(name, config ?? {}, dlqSchema, dlqColumns);
|
|
1698
|
+
super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
|
|
1664
1699
|
this.typeGuard = typeGuard;
|
|
1665
1700
|
getMooseInternal().streams.set(name, this);
|
|
1666
1701
|
}
|
|
@@ -1826,8 +1861,8 @@ var Workflow = class {
|
|
|
1826
1861
|
|
|
1827
1862
|
// src/dmv2/sdk/ingestApi.ts
|
|
1828
1863
|
var IngestApi = class extends TypedBase {
|
|
1829
|
-
constructor(name, config, schema, columns) {
|
|
1830
|
-
super(name, config, schema, columns);
|
|
1864
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1865
|
+
super(name, config, schema, columns, void 0, allowExtraFields);
|
|
1831
1866
|
const ingestApis = getMooseInternal().ingestApis;
|
|
1832
1867
|
if (ingestApis.has(name)) {
|
|
1833
1868
|
throw new Error(`Ingest API with name ${name} already exists`);
|
|
@@ -1966,8 +2001,8 @@ var IngestPipeline = class extends TypedBase {
|
|
|
1966
2001
|
ingestApi;
|
|
1967
2002
|
/** The dead letter queue of the pipeline, if configured. */
|
|
1968
2003
|
deadLetterQueue;
|
|
1969
|
-
constructor(name, config, schema, columns, validators) {
|
|
1970
|
-
super(name, config, schema, columns, validators);
|
|
2004
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
2005
|
+
super(name, config, schema, columns, validators, allowExtraFields);
|
|
1971
2006
|
if (config.ingest !== void 0) {
|
|
1972
2007
|
console.warn(
|
|
1973
2008
|
"\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
|
|
@@ -2016,7 +2051,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2016
2051
|
name,
|
|
2017
2052
|
streamConfig,
|
|
2018
2053
|
this.schema,
|
|
2019
|
-
this.columnArray
|
|
2054
|
+
this.columnArray,
|
|
2055
|
+
void 0,
|
|
2056
|
+
this.allowExtraFields
|
|
2020
2057
|
);
|
|
2021
2058
|
this.stream.pipelineParent = this;
|
|
2022
2059
|
}
|
|
@@ -2036,7 +2073,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2036
2073
|
name,
|
|
2037
2074
|
ingestConfig,
|
|
2038
2075
|
this.schema,
|
|
2039
|
-
this.columnArray
|
|
2076
|
+
this.columnArray,
|
|
2077
|
+
void 0,
|
|
2078
|
+
this.allowExtraFields
|
|
2040
2079
|
);
|
|
2041
2080
|
this.ingestApi.pipelineParent = this;
|
|
2042
2081
|
}
|
|
@@ -2201,6 +2240,10 @@ var SqlResource = class {
|
|
|
2201
2240
|
pushesDataTo;
|
|
2202
2241
|
/** @internal Source file path where this resource was defined */
|
|
2203
2242
|
sourceFile;
|
|
2243
|
+
/** @internal Source line number where this resource was defined */
|
|
2244
|
+
sourceLine;
|
|
2245
|
+
/** @internal Source column number where this resource was defined */
|
|
2246
|
+
sourceColumn;
|
|
2204
2247
|
/**
|
|
2205
2248
|
* Creates a new SqlResource instance.
|
|
2206
2249
|
* @param name The name of the resource.
|
|
@@ -2226,7 +2269,12 @@ var SqlResource = class {
|
|
|
2226
2269
|
this.pullsDataFrom = options?.pullsDataFrom ?? [];
|
|
2227
2270
|
this.pushesDataTo = options?.pushesDataTo ?? [];
|
|
2228
2271
|
const stack = new Error().stack;
|
|
2229
|
-
|
|
2272
|
+
const location = getSourceLocationFromStack(stack);
|
|
2273
|
+
if (location) {
|
|
2274
|
+
this.sourceFile = location.file;
|
|
2275
|
+
this.sourceLine = location.line;
|
|
2276
|
+
this.sourceColumn = location.column;
|
|
2277
|
+
}
|
|
2230
2278
|
}
|
|
2231
2279
|
};
|
|
2232
2280
|
|