@514labs/moose-lib 0.6.262 → 0.6.263-ci-10-gc7213e03
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 +35 -3
- package/dist/compilerPlugin.js.map +1 -1
- package/dist/compilerPlugin.mjs +35 -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
|
@@ -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) {
|
|
@@ -1498,8 +1533,8 @@ var Stream = class extends TypedBase {
|
|
|
1498
1533
|
_memoizedProducer;
|
|
1499
1534
|
/** @internal Hash of the configuration used to create the memoized Kafka producer */
|
|
1500
1535
|
_kafkaConfigHash;
|
|
1501
|
-
constructor(name, config, schema, columns) {
|
|
1502
|
-
super(name, config ?? {}, schema, columns);
|
|
1536
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1537
|
+
super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
|
|
1503
1538
|
const streams = getMooseInternal().streams;
|
|
1504
1539
|
if (streams.has(name)) {
|
|
1505
1540
|
throw new Error(`Stream with name ${name} already exists`);
|
|
@@ -1755,7 +1790,7 @@ var DeadLetterQueue = class extends Stream {
|
|
|
1755
1790
|
"Supply the type param T so that the schema is inserted by the compiler plugin."
|
|
1756
1791
|
);
|
|
1757
1792
|
}
|
|
1758
|
-
super(name, config ?? {}, dlqSchema, dlqColumns);
|
|
1793
|
+
super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
|
|
1759
1794
|
this.typeGuard = typeGuard;
|
|
1760
1795
|
getMooseInternal().streams.set(name, this);
|
|
1761
1796
|
}
|
|
@@ -1921,8 +1956,8 @@ var Workflow = class {
|
|
|
1921
1956
|
|
|
1922
1957
|
// src/dmv2/sdk/ingestApi.ts
|
|
1923
1958
|
var IngestApi = class extends TypedBase {
|
|
1924
|
-
constructor(name, config, schema, columns) {
|
|
1925
|
-
super(name, config, schema, columns);
|
|
1959
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
1960
|
+
super(name, config, schema, columns, void 0, allowExtraFields);
|
|
1926
1961
|
const ingestApis = getMooseInternal().ingestApis;
|
|
1927
1962
|
if (ingestApis.has(name)) {
|
|
1928
1963
|
throw new Error(`Ingest API with name ${name} already exists`);
|
|
@@ -2061,8 +2096,8 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2061
2096
|
ingestApi;
|
|
2062
2097
|
/** The dead letter queue of the pipeline, if configured. */
|
|
2063
2098
|
deadLetterQueue;
|
|
2064
|
-
constructor(name, config, schema, columns, validators) {
|
|
2065
|
-
super(name, config, schema, columns, validators);
|
|
2099
|
+
constructor(name, config, schema, columns, validators, allowExtraFields) {
|
|
2100
|
+
super(name, config, schema, columns, validators, allowExtraFields);
|
|
2066
2101
|
if (config.ingest !== void 0) {
|
|
2067
2102
|
console.warn(
|
|
2068
2103
|
"\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
|
|
@@ -2111,7 +2146,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2111
2146
|
name,
|
|
2112
2147
|
streamConfig,
|
|
2113
2148
|
this.schema,
|
|
2114
|
-
this.columnArray
|
|
2149
|
+
this.columnArray,
|
|
2150
|
+
void 0,
|
|
2151
|
+
this.allowExtraFields
|
|
2115
2152
|
);
|
|
2116
2153
|
this.stream.pipelineParent = this;
|
|
2117
2154
|
}
|
|
@@ -2131,7 +2168,9 @@ var IngestPipeline = class extends TypedBase {
|
|
|
2131
2168
|
name,
|
|
2132
2169
|
ingestConfig,
|
|
2133
2170
|
this.schema,
|
|
2134
|
-
this.columnArray
|
|
2171
|
+
this.columnArray,
|
|
2172
|
+
void 0,
|
|
2173
|
+
this.allowExtraFields
|
|
2135
2174
|
);
|
|
2136
2175
|
this.ingestApi.pipelineParent = this;
|
|
2137
2176
|
}
|
|
@@ -2296,6 +2335,10 @@ var SqlResource = class {
|
|
|
2296
2335
|
pushesDataTo;
|
|
2297
2336
|
/** @internal Source file path where this resource was defined */
|
|
2298
2337
|
sourceFile;
|
|
2338
|
+
/** @internal Source line number where this resource was defined */
|
|
2339
|
+
sourceLine;
|
|
2340
|
+
/** @internal Source column number where this resource was defined */
|
|
2341
|
+
sourceColumn;
|
|
2299
2342
|
/**
|
|
2300
2343
|
* Creates a new SqlResource instance.
|
|
2301
2344
|
* @param name The name of the resource.
|
|
@@ -2321,7 +2364,12 @@ var SqlResource = class {
|
|
|
2321
2364
|
this.pullsDataFrom = options?.pullsDataFrom ?? [];
|
|
2322
2365
|
this.pushesDataTo = options?.pushesDataTo ?? [];
|
|
2323
2366
|
const stack = new Error().stack;
|
|
2324
|
-
|
|
2367
|
+
const location = getSourceLocationFromStack(stack);
|
|
2368
|
+
if (location) {
|
|
2369
|
+
this.sourceFile = location.file;
|
|
2370
|
+
this.sourceLine = location.line;
|
|
2371
|
+
this.sourceColumn = location.column;
|
|
2372
|
+
}
|
|
2325
2373
|
}
|
|
2326
2374
|
};
|
|
2327
2375
|
|