@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.
Files changed (35) hide show
  1. package/dist/{browserCompatible-Bqhjy4pn.d.ts → browserCompatible-CpjUXotI.d.ts} +1 -1
  2. package/dist/{browserCompatible-DTtKuO-Y.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 +31 -12
  6. package/dist/browserCompatible.js.map +1 -1
  7. package/dist/browserCompatible.mjs +31 -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 +31 -12
  20. package/dist/dmv2/index.js.map +1 -1
  21. package/dist/dmv2/index.mjs +31 -12
  22. package/dist/dmv2/index.mjs.map +1 -1
  23. package/dist/{index-CQB6bk1i.d.mts → index-Dd3ZmpTq.d.mts} +25 -6
  24. package/dist/{index-CQB6bk1i.d.ts → index-Dd3ZmpTq.d.ts} +25 -6
  25. package/dist/index.d.mts +3 -3
  26. package/dist/index.d.ts +3 -3
  27. package/dist/index.js +31 -12
  28. package/dist/index.js.map +1 -1
  29. package/dist/index.mjs +31 -12
  30. package/dist/index.mjs.map +1 -1
  31. package/dist/moose-runner.js +2 -1
  32. package/dist/moose-runner.js.map +1 -1
  33. package/dist/moose-runner.mjs +2 -1
  34. package/dist/moose-runner.mjs.map +1 -1
  35. package/package.json +1 -1
@@ -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) {
@@ -1525,8 +1533,8 @@ var Stream = class extends TypedBase {
1525
1533
  _memoizedProducer;
1526
1534
  /** @internal Hash of the configuration used to create the memoized Kafka producer */
1527
1535
  _kafkaConfigHash;
1528
- constructor(name, config, schema, columns) {
1529
- super(name, config ?? {}, schema, columns);
1536
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
1537
+ super(name, config ?? {}, schema, columns, void 0, allowExtraFields);
1530
1538
  const streams = getMooseInternal().streams;
1531
1539
  if (streams.has(name)) {
1532
1540
  throw new Error(`Stream with name ${name} already exists`);
@@ -1782,7 +1790,7 @@ var DeadLetterQueue = class extends Stream {
1782
1790
  "Supply the type param T so that the schema is inserted by the compiler plugin."
1783
1791
  );
1784
1792
  }
1785
- super(name, config ?? {}, dlqSchema, dlqColumns);
1793
+ super(name, config ?? {}, dlqSchema, dlqColumns, void 0, false);
1786
1794
  this.typeGuard = typeGuard;
1787
1795
  getMooseInternal().streams.set(name, this);
1788
1796
  }
@@ -1948,8 +1956,8 @@ var Workflow = class {
1948
1956
 
1949
1957
  // src/dmv2/sdk/ingestApi.ts
1950
1958
  var IngestApi = class extends TypedBase {
1951
- constructor(name, config, schema, columns) {
1952
- super(name, config, schema, columns);
1959
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
1960
+ super(name, config, schema, columns, void 0, allowExtraFields);
1953
1961
  const ingestApis = getMooseInternal().ingestApis;
1954
1962
  if (ingestApis.has(name)) {
1955
1963
  throw new Error(`Ingest API with name ${name} already exists`);
@@ -2088,8 +2096,8 @@ var IngestPipeline = class extends TypedBase {
2088
2096
  ingestApi;
2089
2097
  /** The dead letter queue of the pipeline, if configured. */
2090
2098
  deadLetterQueue;
2091
- constructor(name, config, schema, columns, validators) {
2092
- super(name, config, schema, columns, validators);
2099
+ constructor(name, config, schema, columns, validators, allowExtraFields) {
2100
+ super(name, config, schema, columns, validators, allowExtraFields);
2093
2101
  if (config.ingest !== void 0) {
2094
2102
  console.warn(
2095
2103
  "\u26A0\uFE0F DEPRECATION WARNING: The 'ingest' parameter is deprecated and will be removed in a future version. Please use 'ingestApi' instead."
@@ -2101,6 +2109,7 @@ var IngestPipeline = class extends TypedBase {
2101
2109
  if (config.table) {
2102
2110
  const tableConfig = typeof config.table === "object" ? {
2103
2111
  ...config.table,
2112
+ lifeCycle: config.table.lifeCycle ?? config.lifeCycle,
2104
2113
  ...config.version && { version: config.version }
2105
2114
  } : {
2106
2115
  lifeCycle: config.lifeCycle,
@@ -2118,7 +2127,10 @@ var IngestPipeline = class extends TypedBase {
2118
2127
  if (config.deadLetterQueue) {
2119
2128
  const streamConfig = {
2120
2129
  destination: void 0,
2121
- ...typeof config.deadLetterQueue === "object" ? config.deadLetterQueue : {},
2130
+ ...typeof config.deadLetterQueue === "object" ? {
2131
+ ...config.deadLetterQueue,
2132
+ lifeCycle: config.deadLetterQueue.lifeCycle ?? config.lifeCycle
2133
+ } : { lifeCycle: config.lifeCycle },
2122
2134
  ...config.version && { version: config.version }
2123
2135
  };
2124
2136
  this.deadLetterQueue = new DeadLetterQueue(
@@ -2131,14 +2143,19 @@ var IngestPipeline = class extends TypedBase {
2131
2143
  const streamConfig = {
2132
2144
  destination: this.table,
2133
2145
  defaultDeadLetterQueue: this.deadLetterQueue,
2134
- ...typeof config.stream === "object" ? config.stream : { lifeCycle: config.lifeCycle },
2146
+ ...typeof config.stream === "object" ? {
2147
+ ...config.stream,
2148
+ lifeCycle: config.stream.lifeCycle ?? config.lifeCycle
2149
+ } : { lifeCycle: config.lifeCycle },
2135
2150
  ...config.version && { version: config.version }
2136
2151
  };
2137
2152
  this.stream = new Stream(
2138
2153
  name,
2139
2154
  streamConfig,
2140
2155
  this.schema,
2141
- this.columnArray
2156
+ this.columnArray,
2157
+ void 0,
2158
+ this.allowExtraFields
2142
2159
  );
2143
2160
  this.stream.pipelineParent = this;
2144
2161
  }
@@ -2158,7 +2175,9 @@ var IngestPipeline = class extends TypedBase {
2158
2175
  name,
2159
2176
  ingestConfig,
2160
2177
  this.schema,
2161
- this.columnArray
2178
+ this.columnArray,
2179
+ void 0,
2180
+ this.allowExtraFields
2162
2181
  );
2163
2182
  this.ingestApi.pipelineParent = this;
2164
2183
  }