@forzalabs/remora 1.1.14 → 1.1.15

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/index.js CHANGED
@@ -13500,7 +13500,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
13500
13500
 
13501
13501
  // ../../packages/constants/src/Constants.ts
13502
13502
  var CONSTANTS = {
13503
- cliVersion: "1.1.14",
13503
+ cliVersion: "1.1.15",
13504
13504
  backendVersion: 1,
13505
13505
  backendPort: 5088,
13506
13506
  workerVersion: 2,
@@ -13791,6 +13791,10 @@ var ValidatorClass = class {
13791
13791
  try {
13792
13792
  const recursionErrors = this.detectConsumerRecursion(consumer);
13793
13793
  errors.push(...recursionErrors);
13794
+ for (const [i, field] of consumer.fields.entries()) {
13795
+ if (!field.key)
13796
+ errors.push(`Field at index ${i} in consumer "${consumer.name}" is missing the required "key" property`);
13797
+ }
13794
13798
  const allFieldsWithNoFrom = consumer.fields.filter((x) => x.key === "*" && !x.from);
13795
13799
  if (allFieldsWithNoFrom.length > 0 && consumer.producers.length > 1)
13796
13800
  errors.push(`Field with key "*" was used without specifying the "from" producer and multiple producers were found.`);
@@ -18911,8 +18915,9 @@ var ConsumerExecutorClass = class {
18911
18915
  for (const field of fields) {
18912
18916
  const { cField } = field;
18913
18917
  const fieldKey = cField.alias ?? cField.key;
18918
+ let dimension;
18914
18919
  try {
18915
- const dimension = dimensions.find((x) => x.name === cField.key);
18920
+ dimension = dimensions.find((x) => x.name === cField.key);
18916
18921
  if (!dimension) {
18917
18922
  if (cField.fixed && Algo_default.hasVal(cField.default))
18918
18923
  record[fieldKey] = cField.default;
@@ -18921,12 +18926,18 @@ var ConsumerExecutorClass = class {
18921
18926
  else
18922
18927
  throw new Error(`The requested field "${cField.key}" from the consumer is not present in the underlying producer "${producer.name}" (${dimensions.map((x) => x.name).join(", ")})`);
18923
18928
  }
18924
- if (cField.alias && cField.alias !== dimension.name) {
18929
+ } catch (error) {
18930
+ const err = new Error(`Resolving dimension for field "${fieldKey}" of producer "${producer.name}" failed (index: ${recordIndex}): ${error.message}`, { cause: error });
18931
+ Logger_default.error(err);
18932
+ throw err;
18933
+ }
18934
+ try {
18935
+ if (cField.alias && dimension && cField.alias !== dimension.name) {
18925
18936
  record[cField.alias] = record[dimension.name];
18926
18937
  delete record[dimension.name];
18927
18938
  }
18928
18939
  } catch (error) {
18929
- const err = new Error(`Field mapping failed for field "${fieldKey}" of producer "${producer.name}" (index: ${recordIndex}): ${error.message}`, { cause: error });
18940
+ const err = new Error(`Aliasing field "${cField.key}" to "${cField.alias}" of producer "${producer.name}" failed (index: ${recordIndex}): ${error.message}`, { cause: error });
18930
18941
  Logger_default.error(err);
18931
18942
  throw err;
18932
18943
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forzalabs/remora",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "description": "A powerful CLI tool for seamless data translation.",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -13494,7 +13494,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
13494
13494
 
13495
13495
  // ../../packages/constants/src/Constants.ts
13496
13496
  var CONSTANTS = {
13497
- cliVersion: "1.1.14",
13497
+ cliVersion: "1.1.15",
13498
13498
  backendVersion: 1,
13499
13499
  backendPort: 5088,
13500
13500
  workerVersion: 2,
@@ -13785,6 +13785,10 @@ var ValidatorClass = class {
13785
13785
  try {
13786
13786
  const recursionErrors = this.detectConsumerRecursion(consumer);
13787
13787
  errors.push(...recursionErrors);
13788
+ for (const [i, field] of consumer.fields.entries()) {
13789
+ if (!field.key)
13790
+ errors.push(`Field at index ${i} in consumer "${consumer.name}" is missing the required "key" property`);
13791
+ }
13788
13792
  const allFieldsWithNoFrom = consumer.fields.filter((x) => x.key === "*" && !x.from);
13789
13793
  if (allFieldsWithNoFrom.length > 0 && consumer.producers.length > 1)
13790
13794
  errors.push(`Field with key "*" was used without specifying the "from" producer and multiple producers were found.`);
@@ -18510,8 +18514,9 @@ var ConsumerExecutorClass = class {
18510
18514
  for (const field of fields) {
18511
18515
  const { cField } = field;
18512
18516
  const fieldKey = cField.alias ?? cField.key;
18517
+ let dimension;
18513
18518
  try {
18514
- const dimension = dimensions.find((x) => x.name === cField.key);
18519
+ dimension = dimensions.find((x) => x.name === cField.key);
18515
18520
  if (!dimension) {
18516
18521
  if (cField.fixed && Algo_default.hasVal(cField.default))
18517
18522
  record[fieldKey] = cField.default;
@@ -18520,12 +18525,18 @@ var ConsumerExecutorClass = class {
18520
18525
  else
18521
18526
  throw new Error(`The requested field "${cField.key}" from the consumer is not present in the underlying producer "${producer.name}" (${dimensions.map((x) => x.name).join(", ")})`);
18522
18527
  }
18523
- if (cField.alias && cField.alias !== dimension.name) {
18528
+ } catch (error) {
18529
+ const err = new Error(`Resolving dimension for field "${fieldKey}" of producer "${producer.name}" failed (index: ${recordIndex}): ${error.message}`, { cause: error });
18530
+ Logger_default.error(err);
18531
+ throw err;
18532
+ }
18533
+ try {
18534
+ if (cField.alias && dimension && cField.alias !== dimension.name) {
18524
18535
  record[cField.alias] = record[dimension.name];
18525
18536
  delete record[dimension.name];
18526
18537
  }
18527
18538
  } catch (error) {
18528
- const err = new Error(`Field mapping failed for field "${fieldKey}" of producer "${producer.name}" (index: ${recordIndex}): ${error.message}`, { cause: error });
18539
+ const err = new Error(`Aliasing field "${cField.key}" to "${cField.alias}" of producer "${producer.name}" failed (index: ${recordIndex}): ${error.message}`, { cause: error });
18529
18540
  Logger_default.error(err);
18530
18541
  throw err;
18531
18542
  }