@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.
Files changed (35) hide show
  1. package/dist/{browserCompatible-CC6Jamxn.d.ts → browserCompatible-CpjUXotI.d.ts} +1 -1
  2. package/dist/{browserCompatible-GsBQtLKo.d.mts → browserCompatible-fk6xPzoB.d.mts} +1 -1
  3. package/dist/browserCompatible.d.mts +2 -2
  4. package/dist/browserCompatible.d.ts +2 -2
  5. package/dist/browserCompatible.js +60 -12
  6. package/dist/browserCompatible.js.map +1 -1
  7. package/dist/browserCompatible.mjs +60 -12
  8. package/dist/browserCompatible.mjs.map +1 -1
  9. package/dist/compilerPlugin.js +43 -3
  10. package/dist/compilerPlugin.js.map +1 -1
  11. package/dist/compilerPlugin.mjs +43 -3
  12. package/dist/compilerPlugin.mjs.map +1 -1
  13. package/dist/dataModels/toDataModels.js +2 -2
  14. package/dist/dataModels/toDataModels.js.map +1 -1
  15. package/dist/dataModels/toDataModels.mjs +2 -2
  16. package/dist/dataModels/toDataModels.mjs.map +1 -1
  17. package/dist/dmv2/index.d.mts +1 -1
  18. package/dist/dmv2/index.d.ts +1 -1
  19. package/dist/dmv2/index.js +60 -12
  20. package/dist/dmv2/index.js.map +1 -1
  21. package/dist/dmv2/index.mjs +60 -12
  22. package/dist/dmv2/index.mjs.map +1 -1
  23. package/dist/{index-B1HsstjQ.d.mts → index-Dd3ZmpTq.d.mts} +29 -6
  24. package/dist/{index-B1HsstjQ.d.ts → index-Dd3ZmpTq.d.ts} +29 -6
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +60 -12
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +60 -12
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/moose-runner.js +4 -1
  32. package/dist/moose-runner.js.map +1 -1
  33. package/dist/moose-runner.mjs +4 -1
  34. package/dist/moose-runner.mjs.map +1 -1
  35. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -393,8 +393,35 @@ function getSourceFileInfo(stack) {
393
393
  }
394
394
  return {};
395
395
  }
396
+ function getSourceLocationFromStack(stack) {
397
+ if (!stack) return void 0;
398
+ const lines = stack.split("\n");
399
+ for (const line of lines.slice(1)) {
400
+ if (shouldSkipStackLine(line)) {
401
+ continue;
402
+ }
403
+ const v8Match = line.match(/at\s+(?:.*?\s+\()?(.+):(\d+):(\d+)\)?/);
404
+ if (v8Match) {
405
+ return {
406
+ file: v8Match[1],
407
+ line: parseInt(v8Match[2], 10),
408
+ column: parseInt(v8Match[3], 10)
409
+ };
410
+ }
411
+ const smMatch = line.match(/(?:.*@)?(.+):(\d+):(\d+)/);
412
+ if (smMatch) {
413
+ return {
414
+ file: smMatch[1],
415
+ line: parseInt(smMatch[2], 10),
416
+ column: parseInt(smMatch[3], 10)
417
+ };
418
+ }
419
+ }
420
+ return void 0;
421
+ }
396
422
  function getSourceFileFromStack(stack) {
397
- return getSourceFileInfo(stack).file;
423
+ const location = getSourceLocationFromStack(stack);
424
+ return location?.file;
398
425
  }
399
426
 
400
427
  // src/dmv2/typedBase.ts
@@ -413,6 +440,12 @@ var TypedBase = class {
413
440
  validators;
414
441
  /** Optional metadata for the resource, always present as an object. */
415
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;
416
449
  /**
417
450
  * @internal Constructor intended for internal use by subclasses and the compiler plugin.
418
451
  * It expects the schema and columns to be provided, typically injected by the compiler.
@@ -421,8 +454,9 @@ var TypedBase = class {
421
454
  * @param config The configuration object for the resource.
422
455
  * @param schema The JSON schema for the resource's data type T (injected).
423
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).
424
458
  */
425
- constructor(name, config, schema, columns, validators) {
459
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
426
460
  if (schema === void 0 || columns === void 0) {
427
461
  throw new Error(
428
462
  "Supply the type param T so that the schema is inserted by the compiler plugin."
@@ -438,6 +472,7 @@ var TypedBase = class {
438
472
  this.name = name;
439
473
  this.config = config;
440
474
  this.validators = validators;
475
+ this.allowExtraFields = allowExtraFields ?? false;
441
476
  this.metadata = config?.metadata ? { ...config.metadata } : {};
442
477
  const stack = new Error().stack;
443
478
  if (stack) {
@@ -1522,8 +1557,8 @@ var Stream = class extends TypedBase {
1522
1557
  _memoizedProducer;
1523
1558
  /** @internal Hash of the configuration used to create the memoized Kafka producer */
1524
1559
  _kafkaConfigHash;
1525
- constructor(name, config, schema, columns) {
1526
- super(name, config ?? {}, schema, columns);
1560
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
1561
+ super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
1527
1562
  const streams = getMooseInternal().streams;
1528
1563
  if (streams.has(name)) {
1529
1564
  throw new Error(`Stream with name ${name} already exists`);
@@ -1779,7 +1814,7 @@ var DeadLetterQueue = class extends Stream {
1779
1814
  "Supply the type param T so that the schema is inserted by the compiler plugin."
1780
1815
  );
1781
1816
  }
1782
- super(name, config ?? {}, dlqSchema, dlqColumns);
1817
+ super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
1783
1818
  this.typeGuard = typeGuard;
1784
1819
  getMooseInternal().streams.set(name, this);
1785
1820
  }
@@ -1945,8 +1980,8 @@ var Workflow = class {
1945
1980
 
1946
1981
  // src/dmv2/sdk/ingestApi.ts
1947
1982
  var IngestApi = class extends TypedBase {
1948
- constructor(name, config, schema, columns) {
1949
- super(name, config, schema, columns);
1983
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
1984
+ super(name, config, schema, columns, void 0, allowExtraFields);
1950
1985
  const ingestApis = getMooseInternal().ingestApis;
1951
1986
  if (ingestApis.has(name)) {
1952
1987
  throw new Error(`Ingest API with name ${name} already exists`);
@@ -2085,8 +2120,8 @@ var IngestPipeline = class extends TypedBase {
2085
2120
  ingestApi;
2086
2121
  /** The dead letter queue of the pipeline, if configured. */
2087
2122
  deadLetterQueue;
2088
- constructor(name, config, schema, columns, validators) {
2089
- super(name, config, schema, columns, validators);
2123
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
2124
+ super(name, config, schema, columns, validators, allowExtraFields);
2090
2125
  if (config.ingest !== void 0) {
2091
2126
  console.warn(
2092
2127
  "\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
@@ -2135,7 +2170,9 @@ var IngestPipeline = class extends TypedBase {
2135
2170
  name,
2136
2171
  streamConfig,
2137
2172
  this.schema,
2138
- this.columnArray
2173
+ this.columnArray,
2174
+ void 0,
2175
+ this.allowExtraFields
2139
2176
  );
2140
2177
  this.stream.pipelineParent = this;
2141
2178
  }
@@ -2155,7 +2192,9 @@ var IngestPipeline = class extends TypedBase {
2155
2192
  name,
2156
2193
  ingestConfig,
2157
2194
  this.schema,
2158
- this.columnArray
2195
+ this.columnArray,
2196
+ void 0,
2197
+ this.allowExtraFields
2159
2198
  );
2160
2199
  this.ingestApi.pipelineParent = this;
2161
2200
  }
@@ -2320,6 +2359,10 @@ var SqlResource = class {
2320
2359
  pushesDataTo;
2321
2360
  /** @internal Source file path where this resource was defined */
2322
2361
  sourceFile;
2362
+ /** @internal Source line number where this resource was defined */
2363
+ sourceLine;
2364
+ /** @internal Source column number where this resource was defined */
2365
+ sourceColumn;
2323
2366
  /**
2324
2367
  * Creates a new SqlResource instance.
2325
2368
  * @param name The name of the resource.
@@ -2345,7 +2388,12 @@ var SqlResource = class {
2345
2388
  this.pullsDataFrom = options?.pullsDataFrom ?? [];
2346
2389
  this.pushesDataTo = options?.pushesDataTo ?? [];
2347
2390
  const stack = new Error().stack;
2348
- this.sourceFile = getSourceFileFromStack(stack);
2391
+ const location = getSourceLocationFromStack(stack);
2392
+ if (location) {
2393
+ this.sourceFile = location.file;
2394
+ this.sourceLine = location.line;
2395
+ this.sourceColumn = location.column;
2396
+ }
2349
2397
  }
2350
2398
  };
2351
2399